Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nonce to javascipt tag to support strict content security policies #42

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

murraybo
Copy link
Contributor

In our project we are using a strict content security policy (CSP). This includes a script-src with nonce.

Therefore all scripts include inside a page need to use this nonce on their tag.

Rails has build in support for this, but it needs to be used.

This pull request adds nonce: true to javascript_include_tag . If no CSP is configure this does not have any effect.

@murraybo
Copy link
Contributor Author

murraybo commented Sep 4, 2023

The failed CI run looks unrelated to the change. Maybe something with the workflow definition, or maybe a rerun can help.

@kirillplatonov
Copy link
Owner

Yeah, it seems to be a global Github Actions issue today. I will restart it

@kirillplatonov
Copy link
Owner

Thank you for the contribution! 🙌

@kirillplatonov kirillplatonov merged commit 40ec1d4 into kirillplatonov:main Sep 4, 2023
1 check passed
@murraybo
Copy link
Contributor Author

murraybo commented Sep 4, 2023

Thank you for the fast merge and for your tool. It make my life easier every day. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants