aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-03-12 21:54:54 -0400
committerGeorge Claghorn <george@basecamp.com>2018-03-12 23:14:20 -0400
commitfcbe17137db2ae074cc2592f7498366e313f0d9f (patch)
treec6237789d044ec4503ed68c09bd5f2b00269b690 /activestorage/lib/active_storage
parenta061ae91a90a1fbd909f647dcd219af197bd30a9 (diff)
downloadrails-fcbe17137db2ae074cc2592f7498366e313f0d9f.tar.gz
rails-fcbe17137db2ae074cc2592f7498366e313f0d9f.tar.bz2
rails-fcbe17137db2ae074cc2592f7498366e313f0d9f.zip
Fix Azure signed URL generation with newer client lib
Diffstat (limited to 'activestorage/lib/active_storage')
-rw-r--r--activestorage/lib/active_storage/service/azure_storage_service.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activestorage/lib/active_storage/service/azure_storage_service.rb b/activestorage/lib/active_storage/service/azure_storage_service.rb
index ff6b2be135..2867a4e441 100644
--- a/activestorage/lib/active_storage/service/azure_storage_service.rb
+++ b/activestorage/lib/active_storage/service/azure_storage_service.rb
@@ -83,9 +83,8 @@ module ActiveStorage
def url(key, expires_in:, filename:, disposition:, content_type:)
instrument :url, key: key do |payload|
- base_url = url_for(key)
generated_url = signer.signed_uri(
- URI(base_url), false,
+ uri_for(key), false,
service: "b",
permissions: "r",
expiry: format_expiry(expires_in),
@@ -101,9 +100,8 @@ module ActiveStorage
def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)
instrument :url, key: key do |payload|
- base_url = url_for(key)
generated_url = signer.signed_uri(
- URI(base_url), false,
+ uri_for(key), false,
service: "b",
permissions: "rw",
expiry: format_expiry(expires_in)
@@ -120,8 +118,8 @@ module ActiveStorage
end
private
- def url_for(key)
- "#{blobs.host}/#{container}/#{key}"
+ def uri_for(key)
+ blobs.generate_uri("#{container}/#{key}")
end
def blob_for(key)