A platform for community discussion. Free, open, simple.
allow CSP reports to be sent when header isn't set by Discourse (#6594)
Leo McArdle7bc121a065fe
diff --git a/app/controllers/csp_reports_controller.rb b/app/controllers/csp_reports_controller.rbindex 9b81840607f..b0b10912705 100644--- a/app/controllers/csp_reports_controller.rb+++ b/app/controllers/csp_reports_controller.rb@@ -30,6 +30,6 @@ class CspReportsController < ApplicationControllerenddef report_collection_enabled?- ContentSecurityPolicy.enabled? && SiteSetting.content_security_policy_collect_reports+ SiteSetting.content_security_policy_collect_reportsendenddiff --git a/spec/requests/csp_reports_controller_spec.rb b/spec/requests/csp_reports_controller_spec.rbindex e4568776ddb..51852fea0b3 100644--- a/spec/requests/csp_reports_controller_spec.rb+++ b/spec/requests/csp_reports_controller_spec.rb@@ -37,7 +37,7 @@ describe CspReportsController doSiteSetting.content_security_policy_report_only = falseSiteSetting.content_security_policy_collect_reports = truesend_report- expect(response.status).to eq(404)+ expect(response.status).to eq(200)SiteSetting.content_security_policy = truesend_report