Skip to content

Commit

Permalink
fix Content-Security-Policy when using Azure storage (glitch-soc#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsding authored Sep 26, 2023
1 parent fde89a8 commit ebd2017
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def sso_host
assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
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://#{Addressable::URI.parse(attachments_host).host}"
elsif ENV['SWIFT_ENABLED'] == 'true'
Expand Down

0 comments on commit ebd2017

Please sign in to comment.