To auto-submit the form, a bare script tag is generated. If a website has a content security policy, this is not allowed unless the website has enabled the "unsafe_inline" policy (which of course mostly defeats the purpose of a CSP).
This commit update the Repost::Senpai object allow a nonce to be configured to whitelist this inline script tag.
Since Rails supports a CSP out-of-the-box, the repost method has been configured to retrieve the request nonce and provide it to the Repost::Senpai object automatically.
If a nonce is desired outside of Rails (Sinatra, etc) this would have to be configured manually.
To auto-submit the form, a bare script tag is generated. If a website has a content security policy, this is not allowed unless the website has enabled the "unsafe_inline" policy (which of course mostly defeats the purpose of a CSP).
This commit update the
Repost::Senpai
object allow a nonce to be configured to whitelist this inline script tag.Since Rails supports a CSP out-of-the-box, the
repost
method has been configured to retrieve the request nonce and provide it to theRepost::Senpai
object automatically.If a nonce is desired outside of Rails (Sinatra, etc) this would have to be configured manually.