fix Content-Security-Policy when using Azure storage (#2427)
This commit is contained in:
parent
fde89a8fc0
commit
ebd2017524
|
@ -26,7 +26,7 @@ unless Rails.env.development?
|
||||||
assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
|
assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
|
||||||
data_hosts = [assets_host]
|
data_hosts = [assets_host]
|
||||||
|
|
||||||
if ENV['S3_ENABLED'] == 'true'
|
if ENV['S3_ENABLED'] == 'true' || ENV['AZURE_ENABLED'] == 'true'
|
||||||
attachments_host = "https://#{ENV['S3_ALIAS_HOST'] || ENV['S3_CLOUDFRONT_HOST'] || ENV['AZURE_ALIAS_HOST'] || ENV['S3_HOSTNAME'] || "s3-#{ENV['S3_REGION'] || 'us-east-1'}.amazonaws.com"}"
|
attachments_host = "https://#{ENV['S3_ALIAS_HOST'] || ENV['S3_CLOUDFRONT_HOST'] || ENV['AZURE_ALIAS_HOST'] || ENV['S3_HOSTNAME'] || "s3-#{ENV['S3_REGION'] || 'us-east-1'}.amazonaws.com"}"
|
||||||
attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
|
attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
|
||||||
elsif ENV['SWIFT_ENABLED'] == 'true'
|
elsif ENV['SWIFT_ENABLED'] == 'true'
|
||||||
|
|
Loading…
Reference in New Issue