fix: shouldSkipRedirect incorrectly skips cross-domain redirects#942
fix: shouldSkipRedirect incorrectly skips cross-domain redirects#942nicholasio merged 2 commits intodevelopfrom
Conversation
Add host comparison check in shouldSkipRedirect to ensure cross-domain redirects are never skipped, even when pathnames match. This fixes an issue where redirects configured from one domain to another with the same pathname would result in 404 errors instead of proper redirects. Fixes #941 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 4b05c4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Next.js Bundle Analysis for @10up/wp-nextjs-appThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! |
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Summary
shouldSkipRedirectto ensure cross-domain redirects are never skippedFixes #941
Changes
packages/core/src/utils/fetchRedirect.ts:shouldSkipRedirectwhenlinkURL.host !== redirectURL.hostTest plan
🤖 Generated with Claude Code
Note
Low Risk
Small, well-scoped change to redirect-skipping logic with added test coverage; limited to redirect resolution behavior.
Overview
Fixes
fetchRedirectincorrectly treating cross-domain redirects as skippable when the pathname/query matches, by adding a host comparison so cross-domain redirects are always followed.Adds MSW handlers and unit tests covering cross-domain redirects with both identical and different pathnames, and includes a patch changeset for
@headstartwp/core.Written by Cursor Bugbot for commit 4b05c4d. This will update automatically on new commits. Configure here.