railsjazz / rails_live_reload

Live Reload for your Rails app. The easiest way to increase your productivity.
https://www.railsjazz.com/
MIT License
318 stars 8 forks source link

Support for nonce CSP #36

Open aeris opened 1 month ago

aeris commented 1 month ago

Currently rails_live_reload is not usable with decent CSP directive (no unsafe-inline) and the content is blocked This patch use the native rails CSP nonce to whitelist the injected script

See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce https://api.rubyonrails.org/classes/ActionDispatch/ContentSecurityPolicy/Request.html#method-i-content_security_policy_nonce_generator