]> git.ipfire.org Git - pbs.git/commitdiff
backend: Allow assembling absolute URLs
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 13:57:47 +0000 (13:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 13:57:47 +0000 (13:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/__init__.py

index 3bb62632382021856fe005256dcf71022f71bf32..428a84bc8b7d62b86a8be454c865eecf91c84dec 100644 (file)
@@ -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):