From 526a21730a413d195bea370e062a7317d14dd085 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Fri, 6 Sep 2024 13:28:33 +0200 Subject: [PATCH] DEV: Remove `unsafe_eval` from test/theme-test CSP (#28774) not needed anymore --- lib/content_security_policy.rb | 1 - lib/content_security_policy/extension.rb | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib/content_security_policy.rb b/lib/content_security_policy.rb index 7f760c3b79d..f3d32db7c5f 100644 --- a/lib/content_security_policy.rb +++ b/lib/content_security_policy.rb @@ -21,7 +21,6 @@ class ContentSecurityPolicy Extension.theme_extensions(theme_id).each { |extension| builder << extension } Extension.plugin_extensions.each { |extension| builder << extension } builder << Extension.site_setting_extension - builder << Extension.path_specific_extension(path_info) builder.build end diff --git a/lib/content_security_policy/extension.rb b/lib/content_security_policy/extension.rb index 6996e6747de..8ef49fa928f 100644 --- a/lib/content_security_policy/extension.rb +++ b/lib/content_security_policy/extension.rb @@ -7,14 +7,6 @@ class ContentSecurityPolicy { script_src: SiteSetting.content_security_policy_script_src.split("|") } end - def path_specific_extension(path_info) - {}.tap do |obj| - for_qunit_route = !Rails.env.production? && %w[/qunit /wizard/qunit].include?(path_info) - for_qunit_route ||= "/theme-qunit" == path_info - obj[:script_src] = :unsafe_eval if for_qunit_route - end - end - def plugin_extensions [].tap do |extensions| Discourse.plugins.each do |plugin|