Skip to content

Commit

Permalink
🐛 fix csp for local env not recognizing localhost a valid
Browse files Browse the repository at this point in the history
  • Loading branch information
michenly committed Dec 21, 2023
1 parent 707a2e8 commit 3acf60d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/hydrogen/src/csp/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ function createCSPHeader(

// Support localhost in development
if (process.env.NODE_ENV === 'development') {
defaultDirectives.styleSrc = [...styleSrc, 'localhost:*'];
defaultDirectives.defaultSrc = [...defaultSrc, 'localhost:*'];
defaultDirectives.styleSrc = [...styleSrc, 'http://localhost:*'];
defaultDirectives.defaultSrc = [...defaultSrc, 'http://localhost:*'];
defaultDirectives.connectSrc = [
...connectSrc,
'localhost:*',
'http://localhost:*',
// For HMR:
'ws://localhost:*',
'ws://127.0.0.1:*',
Expand Down

0 comments on commit 3acf60d

Please sign in to comment.