From aad4025ce07210c4e331af54e2297077500f713e Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 26 Jun 2019 15:31:35 +0200 Subject: [PATCH] Revert "Download active_storage blobs through proxy" This reverts commit 0b39da7080d592ef5c77a757d19bf6f9ae1d36fa. --- .../service/ds_proxy_service.rb | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/app/lib/active_storage/service/ds_proxy_service.rb b/app/lib/active_storage/service/ds_proxy_service.rb index fe540d591..78c420693 100644 --- a/app/lib/active_storage/service/ds_proxy_service.rb +++ b/app/lib/active_storage/service/ds_proxy_service.rb @@ -25,29 +25,6 @@ module ActiveStorage 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) search = %r{^https://[^/]+/v1/AUTH_[a-f0-9]{32}} replace = 'https://static.demarches-simplifiees.fr'