fix: handle CORS preflight in reverse proxy during local dev#7164
Merged
alexanderMontague merged 2 commits intoMay 12, 2026
Conversation
Contributor
Author
|
I have signed the CLA! |
alfonso-noriega
previously requested changes
May 7, 2026
alfonso-noriega
left a comment
Contributor
There was a problem hiding this comment.
Great fix! I would just ask you to please revert the lock file.
Contributor
Author
Thanks! I reverted the lockfile changes, the PR diff now only contains the reverse proxy fix and its tests :) |
Contributor
|
@0xtlt can you review the linting errors? we will check the Knip failure as it seems not related to your code. Thanks! |
Contributor
|
@0xtlt we can't update since this is a fork, you should just need to rebase and fix the linting errors. Thanks |
f9b674f to
5c549a8
Compare
Contributor
Author
|
Thanks! I rebased the branch on latest main and fixed the linting errors :) Ping me if you need another action @alexanderMontague |
alexanderMontague
approved these changes
May 12, 2026
alexanderMontague
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your contribution!
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.
Summary
The HTTP reverse proxy used by
shopify app devdoes not handle CORS preflight (OPTIONS) requests, which breaks cross-origin fetch calls from UI extensions (e.g. Customer Account extensions calling the app backend through the Cloudflare tunnel).This PR intercepts OPTIONS requests at the proxy level and responds with the appropriate CORS headers, reflecting the client's
Origin,Access-Control-Request-MethodandAccess-Control-Request-Headers.Changes
http-reverse-proxy.ts: intercept OPTIONS before forwarding, respond 204 with CORS headershttp-reverse-proxy.test.ts: 2 new tests (preflight with headers + preflight without)Fixes #7324
Related: #5660