module Main where
import Control.Monad
import Happstack.Server (nullConf, simpleHTTP, ok, dir, seeOther)
main :: IO ()
main = simpleHTTP nullConf $ msum
[ dir "hello" $ ok "Hello, World!"
, dir "goodbye" $ ok "Goodbye, World!"
, seeOther "/hello\n" "/hello"
]
I mistakenly typed out the following server code from the tutorial:
Note the
\ncharacter in the first call to seeOther. This is obviously not a sensible thing for me to have done, however happstack handles it by returning a emptyLocation:in the header which doesn't seem like the right thing to do? Here's a link for unit tests that show this behaviour.https://github.com/Happstack/happstack-server/compare/master...mattyw:01-seeOther-newline?expand=1