From 9fc9581e529bf21a680ed2b4deb98adaf919c366 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Tue, 26 Sep 2023 16:23:27 +0200 Subject: [PATCH] fix Content-Security-Policy when using Azure storage --- config/initializers/content_security_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 1cd20186d45bab..4a0dabb6a915f7 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -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'