Revert "Download active_storage blobs through proxy"
This reverts commit 0b39da7080
.
This commit is contained in:
parent
0b39da7080
commit
aad4025ce0
1 changed files with 0 additions and 23 deletions
|
@ -25,29 +25,6 @@ module ActiveStorage
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def object_for(key, &block)
|
|
||||||
blob_url = url(key)
|
|
||||||
if block_given?
|
|
||||||
request = Typhoeus::Request.new(blob_url)
|
|
||||||
request.on_headers do |response|
|
|
||||||
if response.code != 200
|
|
||||||
raise Fog::OpenStack::Storage::NotFound.new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
request.on_body do |chunk|
|
|
||||||
yield chunk
|
|
||||||
end
|
|
||||||
request.run
|
|
||||||
else
|
|
||||||
response = Typhoeus.get(blob_url)
|
|
||||||
if response.success?
|
|
||||||
response
|
|
||||||
else
|
|
||||||
raise Fog::OpenStack::Storage::NotFound.new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def publicize(url)
|
def publicize(url)
|
||||||
search = %r{^https://[^/]+/v1/AUTH_[a-f0-9]{32}}
|
search = %r{^https://[^/]+/v1/AUTH_[a-f0-9]{32}}
|
||||||
replace = 'https://static.demarches-simplifiees.fr'
|
replace = 'https://static.demarches-simplifiees.fr'
|
||||||
|
|
Loading…
Reference in a new issue