-
Notifications
You must be signed in to change notification settings - Fork 89
fix: pass only first language to next-server to match platform redirects support #2138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ee3a48e
fix: pass only first language to next-server to match platform redire…
pieh d4ea6e6
test: add test case
pieh dc1c7da
test: some cleanup in cypress test, extra assertion and some more com…
pieh 4c85c21
fix: apply accept-language filtering only in ODB mode
pieh d262660
test: add escape hatch to use ~odb handling when not actually using odb
pieh 460a556
Merge branch 'main' into fix/non-first-language-locale-redirect
orinokai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be done just for
odb
mode, and letssr
keep all languages, but it feels weird to change behavior between 2 of them?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, but worse, if we change it for SSR too it's going to be a breaking change because it will stop Next.js handling non-primary locales, meaning users with secondary/tertiary languages in their
accept-language
header will no longer see content in their language on SSR pages 😬There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having different behaviour between SSR/ODB feels wrong, and I guess it's because what we're doing is actually trying to workaround our lack of support by imposing the same limitation on Next, which would be a regression.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, to me it's picking one of 2 bad options and figuring it which one is worse/better. I do agree it's probably better to keep SSR pages behaving as they are (so supporting matching on all languages on the header, even if there are multiple source that can produce redirect) and limit the workaround to just ODB (it does technically make things worse to match on lowest common denominator to avoid caching wrong things, so we want to limit area we make ~worse).
In any case 4c85c21 limits the workaround just to ODB