Repository navigation
fix(hosting): never negotiate an Accept-Language entry with q=0 (#792) - #806
Merged
Merged
Conversation
Deploying simple-module-python with
|
| Latest commit: |
a2d9e02
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3a1bffcb.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-locale-q0.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
LocaleMiddleware._negotiateskips Accept-Language candidates whose weight isq<=0(RFC 9110 §12.4.2, "not acceptable") ornan, soes;q=0no longer selectses. A refused regional tag (es-MX;q=0) does not fall back to its primary language either.qis read case-insensitively from any parameter position and with spaces around=(es;charset=x;q=0,es; q = 0,es;Q=0), so the refusal can't be missed by parameter order.inf) count as 1, so an out-of-range weight cannot outrank an unweighted tag; header order breaks the tie.docs/framework/i18n.md,docs/framework/middleware.md,docs/framework-conventions.md) and CHANGELOG (marked as a behaviour change) updated.Closes #792
Verification
enandesenabled (port 8241): 11 Accept-Language header variants, a signed-in admin page, and the language switcher, whose cookie still wins over a header refusing Spanish.make lint,make test-py(7,580 passed, 43 skipped),make test-js(891 passed),make doctor, e2e suite (53 passed) all greenQA Report
escatalog (users module has noes.json; some admin nav labels untranslated)Test plan
SM_I18N_SUPPORTED_LOCALES='["en","es"]',curl -H 'Accept-Language: es;q=0' /users/loginrenders<html lang="en">https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq