on master help sign in
Add failing test case to demonstrate #644
661257fMichael Snoyman
warp/test/RunSpec.hs+6
@@ -377,6 +377,12 @@ spec = do
377 res <- sendGET $ "http://127.0.0.1:" ++ show port
377 res <- sendGET $ "http://127.0.0.1:" ++ show port
378 rspBody res `shouldBe` "HelloHelloHelloHello"
378 rspBody res `shouldBe` "HelloHelloHelloHello"
379
379
380+ it "file with non-200 status #644" $ do
381+ let app _ f = f $ responseFile status404 [] "attic/test.txt" Nothing
382+ withApp defaultSettings app $ \port -> do
383+ res <- sendHEAD $ "http://127.0.0.1:" ++ show port
384+ rspCode res `shouldBe` (4, 0, 4)
385+
380 describe "head requests" $ do
386 describe "head requests" $ do
381 let fp = "test/head-response"
387 let fp = "test/head-response"
382 let app req f =
388 let app req f =