You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
So we can implement a Content Security Policy that does not allow
unsafe-inline
scripts to be loaded we should sign our script tags with anonce
.A
nonce
can be generated in server middleware on each request usingnpm uuid
, assigned to the locals object and the CSPscript-src
directive.When the template is rendered the placeholder is substituted with the value of
locals.nonce
If the value of the placeholder attribute (the
nonce
value we just set) and the value of thenonce
on the server match then the request can proceedAssociated issues
UKHomeOfficeForms/hof#105
alphagov/govuk_template#258
The text was updated successfully, but these errors were encountered: