file upload: proxy direct upload through the APP_HOST

Ref #3409
This commit is contained in:
Mathieu Magnin 2019-02-14 13:17:05 +00:00 committed by Pierre de La Morinerie
parent 6e9662b765
commit 2365efbdaa
2 changed files with 9 additions and 6 deletions

View file

@ -27,7 +27,7 @@ module ActiveStorage
def publicize(url)
search = %r{^https://[^/]+/v1/AUTH_[a-f0-9]{32}}
replace = 'https://static.demarches-simplifiees.fr'
replace = "https://#{ENV['APP_HOST']}/direct-upload"
url.gsub(search, replace)
end
end