Yesod.Core.Handler.languages checks first for a language set in the
user's session, prepending that value to YesodRequest{reqLangs}, so it
is respected above all else if present.
For context, reqLangs itself also includes the session, but just later
in line:
langs' = catMaybes [ lookup langKey gets -- Query _LANG
, lookup langKey cookies -- Cookie _LANG
, lookupText langKey session -- Session _LANG
] ++ langs -- Accept-Language(s)
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 to reqLangs, so
that is what this patch does.
|
||
|---|---|---|
| .. | ||
| attic | ||
| bench | ||
| src/Yesod | ||
| static | ||
| test | ||
| .gitignore | ||
| bench.sh | ||
| ChangeLog.md | ||
| helloworld.hs | ||
| LICENSE | ||
| README.md | ||
| Setup.lhs | ||
| yesod-core.cabal | ||
yesod-core
This is the main package for Yesod, providing all core functionality on which other packages can be built. It provides dispatch, handler functions, widgets, etc.
Yesod is well documented on its website.