From 513d6ed4f9cb970be4ce5d90f52caaf1cc05e871 Mon Sep 17 00:00:00 2001 From: "David L. L. Thomas" Date: Sun, 25 Nov 2012 11:12:39 -0800 Subject: [PATCH] Bugfix - Caching redirect *only* for 301 redirects Previous commit got it backwards. --- yesod-core/Yesod/Handler.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-core/Yesod/Handler.hs b/yesod-core/Yesod/Handler.hs index 651ac200..9a952752 100644 --- a/yesod-core/Yesod/Handler.hs +++ b/yesod-core/Yesod/Handler.hs @@ -526,7 +526,7 @@ runHandler handler mrender sroute tomr master sub upload log' = [ 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 []) + hs = (if status /= H.movedPermanently301 then disable_caching else []) ++ Header "Location" (encodeUtf8 loc) : appEndo headers [] return $ YARPlain status hs typePlain emptyContent