@@ -369,6 +369,13 @@ spec = do
369369 bs <- safeRecv socket 4096
370370 S.takeWhile (/= 13) bs `shouldBe` "HTTP/1.1 200 OK"
371371
372+ it "streaming response with length" $ do
373+ let app _ f = f $ responseStream status200 [("content-length", "20")] $ \write _ -> do
374+ replicateM_ 4 $ write $ fromByteString "Hello"
375+ withApp defaultSettings app $ \port -> do
376+ Right res <- HTTP.simpleHTTP (HTTP.getRequest $ "http://127.0.0.1:" ++ show port)
377+ HTTP.rspBody res `shouldBe` "HelloHelloHelloHello"
378+
372379consumeBody :: IO ByteString -> IO [ByteString]
373380consumeBody body =
374381 loop id