Skip to content
Snippets Groups Projects
Verified Commit b017ece7 authored by jan.hamal.dvorak's avatar jan.hamal.dvorak
Browse files

Add redirect function

parent bf0eda50
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ module Web.Hikaru.Action
, sendText
, sendString
, sendJSON
, redirect
, setResponseFile
, setResponseBuilder
, setResponseBS
......@@ -843,6 +844,16 @@ where
setResponseBS (encode json)
-- |
-- Set the @Location@ header and response status to redirect the user
-- elsewhere.
--
redirect :: (MonadAction m) => Text -> m ()
redirect location = do
setStatus status302
setHeader hLocation (cs location)
-- |
-- Create response body using a file.
--
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment