on master help sign in
Add failing test case to demonstrate #644
commit661257ff6eaad454b83572604013f4998d5478a5 authorMichael Snoyman <michael@snoyman.com> dateSun 20 Aug 2017, 10:06 (9 years ago) parent5e41ebe
1 file changed+6
warp/test/RunSpec.hs+6
warp/test/RunSpec.hs+6
@@ -377,6 +377,12 @@ spec = do
377377 res <- sendGET $ "http://127.0.0.1:" ++ show port
378378 rspBody res `shouldBe` "HelloHelloHelloHello"
379379
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+
380386 describe "head requests" $ do
381387 let fp = "test/head-response"
382388 let app req f =