Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattyw opened this issue Feb 16, 2017 · 0 comments
Open

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

mattyw opened this issue Feb 16, 2017 · 0 comments
Assignees
Labels

Comments

@mattyw
Copy link

mattyw commented Feb 16, 2017

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

@mattyw mattyw changed the title seeOther return empty string for location is \n appears in argument seeOther return empty string for location if \n appears in argument Feb 17, 2017
@stepcut stepcut added the bug label Feb 20, 2017
@stepcut stepcut self-assigned this Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants