Skip to content

seeOther return empty string for location if \n appears in argument #30

@mattyw

Description

@mattyw

I mistakenly typed out the following server code from the tutorial:

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"
    ]

Note the \n character 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 empty Location: 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions