Only complete icon URLs when given relative or absolute paths

This commit is contained in:
Râu Cao 2023-10-23 16:43:49 +02:00
parent e964e7e52c
commit 261a782963
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -34,7 +34,11 @@ module AppCatalogManager
end
def attach_remote_image(attachment_name, icon)
download_url = "#{@app.url}/#{icon["src"].gsub(/^\//,'')}"
if icon['src'].start_with?("http")
download_url = icon['src']
else
download_url = "#{@app.url}/#{icon["src"].gsub(/^\//,'')}"
end
filename = "#{attachment_name}.png"
key = "web_apps/#{@app.id}/icons/#{attachment_name}.png"