From 5ff59abedcf6f1891c53a91010109b33e8c97436 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 11 Feb 2025 13:57:47 +0000 Subject: [PATCH] backend: Allow assembling absolute URLs Signed-off-by: Michael Tremer --- src/buildservice/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 3bb62632..428a84bc 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -166,14 +166,17 @@ class Backend(object): """ return os.path.relpath(path, self.basepath) - def url_to(self, url): + def url_to(self, *args): """ Takes a relative URL and makes it absolute """ # The base URL baseurl = self.config.get("global", "baseurl") - # Join it all together + # Join the paths together first + url = os.path.join(*args) + + # Make the URL return urllib.parse.urljoin(baseurl, url) def path_to_url(self, path): -- 2.47.2