Allowing cache on 301 redirects

This commit is contained in:
David L. L. Thomas 2012-11-23 13:44:31 -08:00
parent a2ad8fe704
commit 246a024dce

View File

@ -522,11 +522,12 @@ runHandler handler mrender sroute tomr master sub upload log' =
Right c' -> return $ YARPlain status (appEndo headers []) ct c' finalSession
HCError e -> handleError e
HCRedirect status loc -> do
let hs =
let disable_caching =
[ Header "Cache-Control" "no-cache, must-revalidate"
, Header "Expires" "Thu, 01 Jan 1970 05:05:05 GMT"
, Header "Location" (encodeUtf8 loc)
] ++ appEndo headers []
]
hs = (if status == H.movedPermanently301 then disable_caching else [])
++ Header "Location" (encodeUtf8 loc) : appEndo headers []
return $ YARPlain
status hs typePlain emptyContent
finalSession