From 89ccf603d8119c34f5398dbd737e6a0b805234d3 Mon Sep 17 00:00:00 2001 From: Kasper Revsbech Date: Tue, 29 Nov 2022 14:22:46 +0100 Subject: bitbake: fetch2/wget: handle username/password in uri 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. (Bitbake rev: 88350002d45e0aa85ecd5356da2c8d71e450641e) Signed-off-by: Kasper Revsbech Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/wget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/fetch2/wget.py') diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 821afa5b58..d9aaad6b75 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -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 -- cgit v1.2.3-54-g00ecf