Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
eyfs:9.x
Nov 4, 2022
Merged

[9.x] Add CSP nonce to Vite reactRefresh inline script#44816
taylorotwell merged 1 commit into
laravel:9.xfrom
eyfs:9.x

Conversation

@andyvenus

Copy link
Copy Markdown
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

@timacdonald timacdonald left a comment

Copy link
Copy Markdown
Member

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