From 18c6ff0ae12f6b48bc53c8230bf06e01a8d8681d Mon Sep 17 00:00:00 2001 From: Philippe-Alexandre Mathieu Date: Fri, 18 Jul 2025 10:43:37 -0400 Subject: [PATCH] bitbake: fetch2/wget: Keep query parameters in URL during checkstatus When recreating the uri in wget's checkstatus method, we only use the scheme, netloc and path. This completely strips the query parameters from the final URI and potentially breaks the checking functionality from certain fetchers. This is the case for the Azure storage fetcher, as it requires a SAS token that is formatted as a series of query parameters. The error manifests itself when using a private storage account as a PREMIRROR or SSTATE_MIRROR (since regular SRC_URI won't run the checkstatus). This problem is present in scarthgap, but wasn't in kirkstone. CC: Mathieu Dubois-Briand (Bitbake rev: 096301250455e2a83bdd818a56317c62436c9981) Signed-off-by: Philippe-Alexandre Mathieu Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/wget.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 7e43d3bc97..4d19e2134b 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -372,7 +372,10 @@ class Wget(FetchMethod): try: parts = urllib.parse.urlparse(ud.url.split(";")[0]) - uri = "{}://{}{}".format(parts.scheme, parts.netloc, parts.path) + if parts.query: + uri = "{}://{}{}?{}".format(parts.scheme, parts.netloc, parts.path, parts.query) + else: + uri = "{}://{}{}".format(parts.scheme, parts.netloc, parts.path) r = urllib.request.Request(uri) r.get_method = lambda: "HEAD" # Some servers (FusionForge, as used on Alioth) require that the