# Be sure to restart your server when you modify this file. # Define an application-wide content security policy. # See the Securing Rails Applications Guide for more information: # https://guides.rubyonrails.org/security.html#content-security-policy-header Rails.application.configure do config.content_security_policy do |policy| # Default to self for everything, plus blob: for file downloads policy.default_src :self, "blob:" # Scripts: self + per-response nonce (see nonce config below) + blob: for # downloads. No unsafe-inline — importmap/Turbo/Stimulus inline tags carry the # nonce automatically, and the one hand-written inline script is nonced. policy.script_src :self, "blob:" # Styles: self + per-response nonce. No unsafe-inline — Tailwind ships as an # external stylesheet, Turbo's injected