Merge pull request #454 from dlthomas/master
Prevent caching of redirects
This commit is contained in:
commit
918e3c9d2e
@ -522,7 +522,12 @@ runHandler handler mrender sroute tomr master sub upload log' =
|
|||||||
Right c' -> return $ YARPlain status (appEndo headers []) ct c' finalSession
|
Right c' -> return $ YARPlain status (appEndo headers []) ct c' finalSession
|
||||||
HCError e -> handleError e
|
HCError e -> handleError e
|
||||||
HCRedirect status loc -> do
|
HCRedirect status loc -> do
|
||||||
let hs = Header "Location" (encodeUtf8 loc) : appEndo headers []
|
let disable_caching =
|
||||||
|
[ Header "Cache-Control" "no-cache, must-revalidate"
|
||||||
|
, Header "Expires" "Thu, 01 Jan 1970 05:05:05 GMT"
|
||||||
|
]
|
||||||
|
hs = (if status /= H.movedPermanently301 then disable_caching else [])
|
||||||
|
++ Header "Location" (encodeUtf8 loc) : appEndo headers []
|
||||||
return $ YARPlain
|
return $ YARPlain
|
||||||
status hs typePlain emptyContent
|
status hs typePlain emptyContent
|
||||||
finalSession
|
finalSession
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user