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

[9.x] Add CSP nonce to Vite reactRefresh inline script #44816

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

andyvenus
Copy link
Contributor

This PR adds the Laravel Vite CSP nonce to the inline javascript generated by the Blade directive @reactRefresh (Vite::reactRefresh).

This allows hot reloading to work for React projects where unsafe inline javascript is disabled via the CSP.

@andyvenus andyvenus changed the title Add CSP nonce to Vite reactRefresh inline script [9.x] Add CSP nonce to Vite reactRefresh inline script Nov 2, 2022
@taylorotwell taylorotwell marked this pull request as draft November 2, 2022 13:39
Copy link
Member

@timacdonald timacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working as expected. Thanks for the improvement @andyvenus

@timacdonald timacdonald marked this pull request as ready for review November 3, 2022 04:39
@taylorotwell taylorotwell merged commit 6a72083 into laravel:9.x Nov 4, 2022
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.

3 participants