@@ -20,7 +20,7 @@ import Data.Streaming.Network (bindPortTCP, getSocketTCP, safeRecv)
2020import Network.HTTP.Types
2121import Network.Socket
2222import Network.Socket.ByteString (sendAll)
23−import Network.Wai
23+import Network.Wai hiding (responseHeaders)
2424import Network.Wai.Handler.Warp
2525import System.IO (hFlush, hClose, Handle, IOMode(..))
2626import System.IO.Unsafe (unsafePerformIO)
@@ -358,8 +358,8 @@ spec = do
358358 ] ""
359359 withApp defaultSettings app $ \port -> do
360360 res <- sendGET $ "http://127.0.0.1:" ++ show port
361− getHeaderValue HdrServer res `shouldBe` Just "server"
362− getHeaderValue HdrDate res `shouldBe` Just "date"
361+ getHeaderValue hServer (responseHeaders res) `shouldBe` Just "server"
362+ getHeaderValue hDate (responseHeaders res) `shouldBe` Just "date"
363363
364364 it "streaming echo #249" $ do
365365 let app req f = f $ responseStream status200 [] $ \write _ -> do
@@ -382,7 +382,7 @@ spec = do
382382 replicateM_ 4 $ write $ byteString "Hello"
383383 withApp defaultSettings app $ \port -> do
384384 res <- sendGET $ "http://127.0.0.1:" ++ show port
385− rspBody res `shouldBe` "HelloHelloHelloHello"
385+ responseBody res `shouldBe` "HelloHelloHelloHello"
386386
387387 describe "head requests" $ do
388388 let fp = "test/head-response"
@@ -395,19 +395,19 @@ spec = do
395395 _ -> error "invalid path"
396396 it "builder" $ withApp defaultSettings app $ \port -> do
397397 res <- sendHEAD $ concat ["http://127.0.0.1:", show port, "/builder"]
398− rspBody res `shouldBe` ""
398+ responseBody res `shouldBe` ""
399399 it "streaming" $ withApp defaultSettings app $ \port -> do
400400 res <- sendHEAD $ concat ["http://127.0.0.1:", show port, "/streaming"]
401− rspBody res `shouldBe` ""
401+ responseBody res `shouldBe` ""
402402 it "file, no range" $ withApp defaultSettings app $ \port -> do
403403 bs <- S.readFile fp
404404 res <- sendHEAD $ concat ["http://127.0.0.1:", show port, "/file"]
405− getHeaderValue HdrContentLength res `shouldBe` Just (show $ S.length bs)
405+ getHeaderValue hContentLength (responseHeaders res) `shouldBe` Just (S8.pack $ show $ S.length bs)
406406 it "file, with range" $ withApp defaultSettings app $ \port -> do
407407 res <- sendHEADwH
408408 (concat ["http://127.0.0.1:", show port, "/file"])
409− [mkHeader HdrRange "bytes=0-1"]
410− getHeaderValue HdrContentLength res `shouldBe` Just "2"
409+ [(hRange, "bytes=0-1")]
410+ getHeaderValue hContentLength (responseHeaders res) `shouldBe` Just "2"
411411
412412consumeBody :: IO ByteString -> IO [ByteString]
413413consumeBody body =