lib/fog/azurerm/models/storage/file.rb in gitlab-fog-azure-rm-1.1.1 vs lib/fog/azurerm/models/storage/file.rb in gitlab-fog-azure-rm-1.2.0
- old
+ new
@@ -238,13 +238,21 @@
#
# @return [String] A public url which will expire after the specified time.
#
def url(expires, options = {})
requires :key
- collection.get_url(key, expires, options)
+ collection.get_url(key, expires, normalize_options(options))
end
private
+
+ def normalize_options(options)
+ # AWS S3 and Google Cloud Storage pass response-content-disposition
+ # as a query string, while Azure needs the content_disposition parameter
+ # to generate a SAS token.
+ options[:content_disposition] ||= options.dig(:query, 'response-content-disposition')
+ options
+ end
# Upload blob
def save_blob(options)
if options[:blob_type].nil? || options[:blob_type] == 'BlockBlob'
service.create_block_blob(directory.key, key, body, options)