MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.68k stars 400 forks source link

FEATURE: Support dynamic `config.content_security_policy_nonce` #609

Closed davidtaylorhq closed 4 months ago

davidtaylorhq commented 4 months ago

CSP nonce values change on every request, so accepting a static string as an option doesn't really make sense. This commit allows config.content_security_policy_nonce to be set to a Proc which is run for each request, and can return a nonce based on the env and current response headers.