-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[next]: ensure defaultLocale redirect doesn't conflict with user redi…
…rects (#12916) When `localeDetection` is turned off, usually the user intends to handle redirects themselves, or doesn't want them at all. However because of the rewrites that we insert for `defaultLocale` handling, it can clobber the user-provided redirects. eg the rewrite to `/${defaultLocale}` would then flow through to the user's redirect handling to result in `/${defaultLocale}/${redirectLocale}` which wouldn't have been the intention. When `localeDetection` is turned off, we shouldn't only attempt the defaultLocale rewrite handling when we've already processed all other routes (ie in the `handle: miss` case) Closes NEXT-3975 --------- Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information
Showing
5 changed files
with
131 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@vercel/next': patch | ||
--- | ||
|
||
ensure defaultLocale rewrite doesn't conflict with user-defined redirects |
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
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