[Minor][Fix] Replace automatic App Bridge CSP with opt-in helper method#2017
Merged
[Minor][Fix] Replace automatic App Bridge CSP with opt-in helper method#2017
Conversation
Prevents breaking changes from PR #1997 which would force script-src on all apps Apps using default template (CSP disabled) must continue working without changes. Only apps explicitly enabling strict CSP should need App Bridge configuration. Breaking change avoided: PR #1997 automatically added script-src 'self' to all apps, blocking inline scripts including Vite HMR in development. This reverts to opt-in. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
sle-c
approved these changes
Oct 22, 2025
byrichardpowell
approved these changes
Oct 27, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
PR #1997 automatically added the App Bridge script source (https://cdn.shopify.com/shopifycloud/app-bridge.js) to CSP headers for all
apps. This would cause breaking changes:
What this PR does
This PR reverts the automatic approach and provides an opt-in helper method instead:
Benefits:
Alternatives Considered
controller-level content_security_policy blocks completely replace application-level CSP configuration, making it impossible to read or
preserve the developer's application-level settings.
Reviewer's guide to testing
Things to focus on
Checklist
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.mdif the changes would impact usersREADME.md, if appropriate./docs, if necessary