Repository navigation
Conversation
This branch has not been deployed
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 are these changes introduced?
In
shopify theme devand theme app extension previews inshopify app dev, clicking a link to another site always showed the storefront's "leaving this store" confirmation page. That happened even when the live store or the admin theme preview sends the shopper straight there.The dev server's proxy caused it in two ways:
/url) only continues to another site when the request is a real navigation (Sec-Fetch-Mode: navigate). The browser sends that header to the local server. The CLI then re-sends the request with Node's globalfetch, which always replacesSec-Fetch-Modewith its own request mode (cors). So the storefront showed the confirmation page every time.Locationheader.https://example.com/became/, and the shopper landed back on the local server.WHAT is this pull request doing?
storefront-renderer.ts: a GET to the exit page (/urlor/:locale/url) is sent with cli-kit'sfetch(node-fetch), which forwards the browser'sSec-Fetch-*headers unchanged.redirect: 'manual'and the same error handling.slow-requestmode, so there are no retries and no timeout, the same as the globalfetch.Response, and everySet-Cookieis kept.proxy.ts: aLocationheader is only turned into a local path when it points to the store (a relative path or the store's domain). Redirects to other hosts stay absolute. For store redirects, the existing_fd/pbcleanup and the checkout exception are unchanged.How to manually test your changes?
shopify theme dev, orshopify app devwith a theme app extension, using this branch.https://example.com/)./cartor localization redirects) and checkout should work as before.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add