Altered nonce comment (modeled after encryptKey).
I note that for `key' == Nothing` it should probably hold that `session' == []` as implemented in defaultYesodRunner, so perhaps the comment regarding ignoring pre-existing `nonceKey` is redundant. But a custom `yesodRunner` could arguably violate this invariant(?).
This commit is contained in:
parent
4d1ea8520a
commit
39ef74cb10
@ -60,9 +60,9 @@ parseWaiRequest' env session' key' gen = Request gets'' cookies' env langs' nonc
|
||||
, lookup langKey cookies' -- Cookie _LANG
|
||||
, lookup langKey session' -- Session _LANG
|
||||
] ++ langs -- Accept-Language(s)
|
||||
-- If the session is not secure a nonce should not be
|
||||
-- used (any nonce present in the session is ignored).
|
||||
-- If a secure session has no nonceKey a new one is
|
||||
-- If sessions are disabled nonces should not be used (any
|
||||
-- nonceKey present in the session is ignored). If sessions
|
||||
-- are enabled and a session has no nonceKey a new one is
|
||||
-- generated.
|
||||
nonce = case (key', lookup nonceKey session') of
|
||||
(Nothing, _) -> Nothing
|
||||
|
||||
Loading…
Reference in New Issue
Block a user