Stop moving session language ahead of reqLangs #1721
Merged
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.
Yesod.Core.Handler.languages
checks first for a language set in the user'ssession, prepending that value to
YesodRequest{reqLangs}
, so it is respectedabove all else if present.
For context,
reqLangs
itself also includes the session, but just later inline:
In #1720, it was raised that allowing the session (something implicitly present
for any request) to override a query parameter (something explicitly given on
that request) is surprising.
We decided (without knowing what order
reqLangs
was doing) that query, cookie,session, accept was best and
languages
should be changed to do that.Conveniently, this just makes
languages
equivalent toreqLangs
, so that iswhat this patch does.
I'll do this in a fast-follow:
After submitting your PR: