0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 06:24:48 +08:00
discourse/app/services/problem_check/content_security_policy_disabled.rb
David Taylor 295806c725
FEATURE: Warn admins when Content Security Policy is disabled (#40791)
When disabled, admins will be shown this warning in the dashboard:

> The content-security-policy feature has been disabled. This is an
important security feature, and should never be disabled in production
environments. <a href=''>Re-enable it here</a>.
2026-06-11 11:34:37 +01:00

11 lines
216 B
Ruby
Vendored

# frozen_string_literal: true
class ProblemCheck::ContentSecurityPolicyDisabled < ProblemCheck
self.priority = "low"
def call
return no_problem if SiteSetting.content_security_policy
problem
end
end