yesod/yesod-core
patrick brisbin dc2d5d9cd0
Stop moving session language ahead of reqLangs
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.
2021-04-08 09:34:38 -04:00
..
attic Added pong.hs 2013-03-17 12:48:11 +02:00
bench Cleanup warnings 2018-01-15 15:09:07 +02:00
src/Yesod Stop moving session language ahead of reqLangs 2021-04-08 09:34:38 -04:00
static Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
test Fix test suite for latest wai-extra (fixes #1711) 2020-12-14 11:29:11 +02:00
.gitignore Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
bench.sh Remove a painful slowdown from randomIV 2011-11-25 15:11:15 +02:00
ChangeLog.md Fix test suite for latest wai-extra (fixes #1711) 2020-12-14 11:29:11 +02:00
helloworld.hs MonadHandler/MonadWidget 2013-03-17 10:10:39 +02:00
LICENSE Update license with MIT license 2012-04-29 09:38:45 +03:00
README.md README.md 2014-11-23 12:18:41 +02:00
Setup.lhs Add 'yesod-core/' from commit '982d6185bee75b078bee92bd8a2e8743707f1922' 2011-07-22 08:59:56 +03:00
yesod-core.cabal Forgot to update cabal file 2020-12-14 11:30:14 +02:00

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.