-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔥 remove applyDefault option and make extension the default behaviour
- Loading branch information
Showing
3 changed files
with
11 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
--- | ||
'@shopify/hydrogen': patch | ||
'@shopify/hydrogen': minor | ||
--- | ||
|
||
✨ add `applyDefault` option to `createContentSecurityPolicy` which automatically adds Shopify domains to the content security policy, extending whatever rules are passed instead of overriding them. The default value of `applyDefault` option is false which is the current behavior. | ||
|
||
Example usage: | ||
|
||
```diff | ||
const {nonce, header, NonceProvider} = createContentSecurityPolicy( | ||
{connectSrc: 'wss://public-domain:*'}, | ||
+ {applyDefault: true}, | ||
); | ||
``` | ||
|
||
Result of connect-src when `applyDefault=false` is "wss://public-domain:\*" | ||
|
||
Result of connect-src when `applyDefault=true` is "wss://public-domain:\* 'self' 'https://cdn.shopify.com' 'https://shopify.com'" | ||
💥 Change the behaviour of `createContentSecurityPolicy` where the custom rules passed in will extends the default Shopify and development domains instead of overriding them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters