packages feed

http-client 0.4.3 → 0.4.4

raw patch · 7 files changed

+24/−2 lines, 7 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.4.4++Add `managerModifyRequest` field to `ManagerSettings`.+ ## 0.4.3  Add `requestVersion` field to `Request`.
Network/HTTP/Client.hs view
@@ -103,6 +103,7 @@     , managerRetryableException     , managerWrapIOException     , managerIdleConnectionCount+    , managerModifyRequest       -- *** Helpers     , rawConnectionModifySocket       -- * Request
Network/HTTP/Client/Core.hs view
@@ -71,7 +71,8 @@      :: Request      -> Manager      -> IO (Response BodyReader)-httpRaw req' m = do+httpRaw req0 m = do+    req' <- mModifyRequest m req0     (req, cookie_jar') <- case cookieJar req' of         Just cj -> do             now <- getCurrentTime
Network/HTTP/Client/Manager.hs view
@@ -92,6 +92,7 @@                     Nothing -> se          in handle $ throwIO . wrapper     , managerIdleConnectionCount = 512+    , managerModifyRequest = return     }  takeSocket :: Manager -> ConnKey -> IO (Maybe Connection)@@ -169,6 +170,7 @@             , mRetryableException = managerRetryableException ms             , mWrapIOException = managerWrapIOException ms             , mIdleConnectionCount = managerIdleConnectionCount ms+            , mModifyRequest = managerModifyRequest ms             }     return manager 
Network/HTTP/Client/Types.hs view
@@ -502,6 +502,12 @@     -- Default: 512     --     -- Since 0.3.7+    , managerModifyRequest :: Request -> IO Request+    -- ^ Perform the given modification to a @Request@ before performing it.+    --+    -- Default: no modification+    --+    -- Since 0.4.4     }     deriving T.Typeable @@ -529,6 +535,7 @@     , mRetryableException :: SomeException -> Bool     , mWrapIOException :: forall a. IO a -> IO a     , mIdleConnectionCount :: Int+    , mModifyRequest :: Request -> IO Request     }     deriving T.Typeable 
http-client.cabal view
@@ -1,5 +1,5 @@ name:                http-client-version:             0.4.3+version:             0.4.4 synopsis:            An HTTP client engine, intended as a base layer for more user-friendly packages. description:         This codebase has been refactored from http-conduit. homepage:            https://github.com/snoyberg/http-client
test/Network/HTTP/ClientSpec.hs view
@@ -104,3 +104,10 @@                     responseBody x `shouldBe` "hello"         test False         test True++    it "managerModifyRequest" $ do+        let modify req = return req { port = 80 }+            settings = defaultManagerSettings { managerModifyRequest = modify }+        withManager settings $ \man -> do+            res <- httpLbs "http://httpbin.org:1234" man+            responseStatus res `shouldBe` status200