packages feed

http-conduit 2.1.2.2 → 2.1.2.3

raw patch · 2 files changed

+27/−7 lines, 2 filesdep ~http-clientdep ~http-client-tlsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: http-client, http-client-tls

API changes (from Hackage documentation)

Files

http-conduit.cabal view
@@ -1,5 +1,5 @@ name:            http-conduit-version:         2.1.2.2+version:         2.1.2.3 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -29,8 +29,8 @@                  , conduit               >= 0.5.5   && < 1.2                  , http-types            >= 0.7                  , lifted-base           >= 0.1-                 , http-client           >= 0.3.2   && < 0.4-                 , http-client-tls+                 , http-client           >= 0.3.3.2 && < 0.4+                 , http-client-tls       >= 0.2.1.2                  , monad-control                  , mtl     exposed-modules: Network.HTTP.Conduit
test/main.hs view
@@ -9,7 +9,7 @@ import Network.Wai hiding (requestBody) import Network.Wai.Conduit (responseSource, sourceRequestBody) import qualified Network.Wai as Wai-import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort, settingsBeforeMainLoop)+import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort, settingsBeforeMainLoop, Settings, setTimeout) import Network.HTTP.Conduit hiding (port) import qualified Network.HTTP.Conduit as NHC import Network.HTTP.Client.MultipartFormData@@ -117,14 +117,20 @@ withApp app' f = withApp' (const app') f  withApp' :: (Int -> Wai.Request -> IO Wai.Response) -> (Int -> IO ()) -> IO ()-withApp' app' f = do+withApp' = withAppSettings id++withAppSettings :: (Settings -> Settings)+                -> (Int -> Wai.Request -> IO Wai.Response)+                -> (Int -> IO ())+                -> IO ()+withAppSettings modSettings app' f = do     port <- getPort     baton <- newEmptyMVar     bracket-        (forkIO $ runSettings defaultSettings+        (forkIO $ runSettings (modSettings defaultSettings             { settingsPort = port             , settingsBeforeMainLoop = putMVar baton ()-            } (app'' port) `onException` putMVar baton ())+            }) (app'' port) `onException` putMVar baton ())         killThread         (const $ takeMVar baton >> f port)   where@@ -413,6 +419,20 @@             withManager $ \man -> do                 _ <- http req man                 return ()++    it "reuse/connection close tries again" $ do+        withAppSettings (setTimeout 1) (const app) $ \port -> do+            req <- parseUrl $ "http://localhost:" ++ show port+            withManager $ \man -> do+                res1 <- httpLbs req man+                liftIO $ threadDelay 3000000+                res2 <- httpLbs req man+                let f res = res+                        { NHC.responseHeaders = filter (not . isDate) (NHC.responseHeaders res)+                        }+                    isDate ("date", _) = True+                    isDate _ = False+                liftIO $ f res2 `shouldBe` f res1  withCApp :: (Data.Conduit.Network.AppData -> IO ()) -> (Int -> IO ()) -> IO () withCApp app' f = do