Skip to content

A platform for community discussion. Free, open, simple.

DEV: Allow `unsafe-eval` in development mode

Gerhard Schlagere7402b3feb11
diff --git a/lib/content_security_policy/default.rb b/lib/content_security_policy/default.rb
index 7a6f1d24a5f..d0c8203dd56 100644
--- a/lib/content_security_policy/default.rb
+++ b/lib/content_security_policy/default.rb
@@ -51,6 +51,7 @@ class ContentSecurityPolicy
"#{base_url}/mini-profiler-resources/",
*script_assets
].tap do |sources|
+ sources << :unsafe_eval if Rails.env.development? # TODO Remove this when we stop using `eval` in development mode
sources << 'https://www.google-analytics.com/analytics.js' if SiteSetting.ga_universal_tracking_code.present?
sources << 'https://www.googletagmanager.com/gtm.js' if SiteSetting.gtm_container_id.present?
end