backend: add trailing slash if needed

Otherwise we can redirect to something like this:

https://console.redhat.com/api/pulp-content/public-copr-stage@copr/TEST1742912352410340284-storage-pulp/fedora-41-x86_64/
This commit is contained in:
Jakub Kadlcik 2025-03-25 19:43:00 +01:00
parent 4ab30bdc37
commit 6d9ff9b5f2

View file

@ -52,7 +52,14 @@ function pulp_url(copr_path)
if string.sub(copr_path, 1, 9) == "/results/" then
copr_path = string.sub(copr_path, 10)
end
return pulp_content_url .. copr_path
local url = pulp_content_url
if string.sub(url, -1) ~= "/" then
url = url .. "/"
end
url = url .. copr_path
return url
end