summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKasper Revsbech <kasper.revsbech.ext@siemensgamesa.com>2022-11-29 14:22:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-09 13:22:11 +0000
commit89ccf603d8119c34f5398dbd737e6a0b805234d3 (patch)
treedea142c409fa3c189dbcd447dfe2efa58bc87542
parenta9505a86fdcd789093732b800ba08e7a23c21070 (diff)
downloadpoky-89ccf603d8119c34f5398dbd737e6a0b805234d3.tar.gz
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 <kasper.revsbech.ext@siemensgamesa.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/wget.py3
1 files changed, 2 insertions, 1 deletions
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):
341 opener = urllib.request.build_opener(*handlers) 341 opener = urllib.request.build_opener(*handlers)
342 342
343 try: 343 try:
344 uri = ud.url.split(";")[0] 344 uri_base = ud.url.split(";")[0]
345 uri = "{}://{}{}".format(urllib.parse.urlparse(uri_base).scheme, ud.host, ud.path)
345 r = urllib.request.Request(uri) 346 r = urllib.request.Request(uri)
346 r.get_method = lambda: "HEAD" 347 r.get_method = lambda: "HEAD"
347 # Some servers (FusionForge, as used on Alioth) require that the 348 # Some servers (FusionForge, as used on Alioth) require that the