yesod-test: use HTTP/1.1
This commit is contained in:
parent
4158353070
commit
33c384bb4e
@ -577,7 +577,11 @@ request reqBuilder = do
|
||||
-- else makeSinglepart
|
||||
-- BinaryPostData _ -> makeSinglepart
|
||||
-- let req = maker cookiesForPath rbdPostData rbdMethod rbdHeaders path rbdGets
|
||||
response <- liftIO $ runSession (srequest req) app
|
||||
response <- liftIO $ runSession (srequest req
|
||||
{ simpleRequest = (simpleRequest req)
|
||||
{ httpVersion = H.http11
|
||||
}
|
||||
}) app
|
||||
let newCookies = map (Cookie.parseSetCookie . snd) $ DL.filter (("Set-Cookie"==) . fst) $ simpleHeaders response
|
||||
cookies' = M.fromList [(Cookie.setCookieName c, c) | c <- newCookies] `M.union` cookies
|
||||
ST.put $ YesodExampleData app site cookies' (Just response)
|
||||
|
||||
@ -137,7 +137,7 @@ main = hspec $ do
|
||||
get ("/" :: Text)
|
||||
statusIs 200
|
||||
post ("/cookie/foo" :: Text)
|
||||
statusIs 302
|
||||
statusIs 303
|
||||
get ("/" :: Text)
|
||||
statusIs 200
|
||||
printBody
|
||||
|
||||
Loading…
Reference in New Issue
Block a user