From 90975e19c763fc1ba49aadcd2d68f69a13714db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= <mordae@anilinux.org> Date: Thu, 16 May 2019 10:17:28 +0200 Subject: [PATCH] Use 303 for redirects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Hamal Dvořák <mordae@anilinux.org> --- lib/Web/Hikaru/Action.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Web/Hikaru/Action.hs b/lib/Web/Hikaru/Action.hs index 14965d3..a3742a0 100644 --- a/lib/Web/Hikaru/Action.hs +++ b/lib/Web/Hikaru/Action.hs @@ -892,12 +892,13 @@ where -- | - -- Set the @Location@ header and response status to redirect the user - -- elsewhere. + -- Set the response status to 303 (See Other), that will cause the browser + -- to obtain the address specified in the supplied @Location@ header using + -- the @GET@ method. -- redirect :: (MonadAction m) => Text -> m () redirect location = do - setStatus status302 + setStatus status303 setHeader hLocation (cs location) -- GitLab