http-conduit 1.6.1 → 1.6.1.1
raw patch · 2 files changed
+14/−4 lines, 2 files
Files
- Network/HTTP/Conduit.hs +13/−3
- http-conduit.cabal +1/−1
Network/HTTP/Conduit.hs view
@@ -147,7 +147,9 @@ import Control.Monad.IO.Class (MonadIO (liftIO)) import Control.Monad.Trans.Control (MonadBaseControl) +import Control.Exception (fromException, toException) import qualified Data.Conduit as C+import qualified Data.Conduit.Binary as CB import qualified Data.Conduit.Internal as CI import Data.Conduit.Blaze (builderToByteString) import Data.Conduit (MonadResource)@@ -193,9 +195,17 @@ case checkStatus req0 status hs of Nothing -> return res Just exc -> do- let CI.ResumableSource _ final = body- final- liftIO $ throwIO exc+ exc' <-+ case fromException exc of+ Just (StatusCodeException s hs) -> do+ lbs <- body C.$$+- CB.take 1024+ return $ toException $ StatusCodeException s $ hs +++ [("X-Response-Body-Start", S.concat $ L.toChunks lbs)]+ _ -> do+ let CI.ResumableSource _ final = body+ final+ return exc+ liftIO $ throwIO exc' where go (-1) _ _ ress = liftIO . throwIO . TooManyRedirects =<< mapM lbsResponse ress go count req'' cookie_jar'' ress = do
http-conduit.cabal view
@@ -1,5 +1,5 @@ name: http-conduit-version: 1.6.1+version: 1.6.1.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>