-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Bugs
When using content_security_policy_nonce(:script) inline in erb, I got the below error:
ActionView::Template::Error: wrong number of arguments (given 1, expected 0)
Looks like in secure_headers' content_security_policy_nonce(:script) is conflicting with Rails' content_security_policy_nonce, which does not take any param, refer to http://edgeapi.rubyonrails.org/classes/ActionDispatch/ContentSecurityPolicy/Request.html#method-i-content_security_policy_nonce
Also in my list of middlewares, I see ActionDispatch::ContentSecurityPolicy::Middleware inserted right after SecureHeaders::Middleware, something like this:
$ bin/rails middleware
...
use SecureHeaders::Middleware
...
use ActionDispatch::ContentSecurityPolicy::Middleware
...
Expected outcome
Expected content_security_policy_nonce(:script) should work as described in https://github.com/twitter/secure_headers/blob/v5.0.5/lib/secure_headers/view_helper.rb#L69-L76
Actual outcome
Rails' content_security_policy_nonce was called