fetch2/wget: handle username/password in uri
PATCH 1/1 fetch2/wget: handle username/password in uri
From: Kasper Revsbech <[email protected]>
In checkstatus() opener.open() is used to check if an artifact is available. The check fails if the uri contains username password in the format:
"username:password@hostname..". Moreover, the checkstatus function already uses the username from the "ud" object to craft a header, is username and password is provided.
This fix ensure the uri in the Requests object used does not contain username as password.
--- lib/bb/fetch2/wget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/fetch2/wget.py +2 -1
@@ -341,7 +341,8 @@ class Wget(FetchMethod): opener = urllib.request.build_opener(*handlers) try: - uri = ud.url.split(";")[0] + uri_base = ud.url.split(";")[0] + uri = "{}://{}{}".format(urllib.parse.urlparse(uri_base).scheme, ud.host, ud.path) r = urllib.request.Request(uri) r.get_method = lambda: "HEAD" # Some servers (FusionForge, as used on Alioth) require that the
Signature · 1 line
2.34.1
Quoted 21 lines · Kasper
From: Kasper Revsbech <[email protected]>
In
checkstatus()opener.open()is used to check if an artifact is available. The check fails if the uri contains username password in the format:
"username:password@hostname..". Moreover, the checkstatus function already uses the username from the "ud" object to craft a header, is username and password is provided.This fix ensure the uri in the Requests object used does not contain username as password.
Signed-off-by Kasper Revsbech <[email protected]>--- lib/bb/fetch2/wget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/bb/fetch2/wget.py +0
-0
lib/bb/fetch2/wget.py class Wget(FetchMethod): · line 348
Quoted 9 lines
lib/bb/fetch2/wget.py +2
-1@@ -341,7 +341,8 @@ class Wget(FetchMethod): opener = urllib.request.build_opener(*handlers) try: - uri = ud.url.split(";")[0] + uri_base = ud.url.split(";")[0] + uri = "{}://{}{}".format(urllib.parse.urlparse(uri_base).scheme, ud.host, ud.path) r = urllib.request.Request(uri) r.get_method = lambda: "HEAD" # Some servers (FusionForge, as used on Alioth) require that the
Didn't this merge back in December?
Cheers,
Richard