http-conduit-browser 1.6.2 → 1.6.3
raw patch · 2 files changed
+24/−24 lines, 2 filesdep ~http-conduitnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: http-conduit
API changes (from Hackage documentation)
Files
Network/HTTP/Conduit/Browser2.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP, ScopedTypeVariables #-} -- | This module is designed to work similarly to the Network.Browser module in the HTTP package. -- The idea is that there are two new types defined: 'BrowserState' and 'BrowserAction'. The -- purpose of this module is to make it easy to describe a browsing session, including navigating@@ -174,7 +174,7 @@ , maxRedirects = max_redirects , timeout = time_out , currentProxy = current_proxy- , currentSocksProxy = current_socks_proxy+ , currentSocksProxy = current_socks_proxy , overrideHeaders = override_headers , browserCheckStatus = current_check_status } <- get@@ -196,7 +196,7 @@ resp <- LE.catch (if max_redirects==0 then (\(_,a,_) -> a) `fmap` performRequest request' else runRedirectionChain request' max_redirects [])- (\ e' -> retryHelper request' (retry_count - 1) max_redirects check_status (Just e'))+ (\ (e'::HttpException) -> retryHelper request' (retry_count - 1) max_redirects check_status $ Just $ toException e') case check_status (responseStatus resp) (responseHeaders resp) of Nothing -> return resp Just e' -> retryHelper request' (retry_count - 1) max_redirects check_status (Just e')@@ -384,19 +384,6 @@ out <- b setOverrideHeaders current return out--- | Function to check the status code. Note that this will run after all redirects are performed.--- if Nothing uses Request's 'checkStatus'-getCheckStatus :: BrowserAction (Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException))-getCheckStatus = get >>= \ a -> return $ browserCheckStatus a-setCheckStatus :: Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException) -> BrowserAction ()-setCheckStatus b = get >>= \ a -> put a {browserCheckStatus = b}-withCheckStatus :: Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException) -> BrowserAction a -> BrowserAction a-withCheckStatus a b = do- current <- getCheckStatus- setCheckStatus a- out <- b- setCheckStatus current- return out insertOverrideHeader :: HT.Header -> BrowserAction () insertOverrideHeader (b, c) = get >>= \ a -> put a {overrideHeaders = Map.insert b c (overrideHeaders a)} deleteOverrideHeader :: HT.HeaderName -> BrowserAction ()@@ -424,6 +411,19 @@ setUserAgent a out <- b setOverrideHeaders current+ return out+-- | Function to check the status code. Note that this will run after all redirects are performed.+-- if Nothing uses Request's 'checkStatus'+getCheckStatus :: BrowserAction (Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException))+getCheckStatus = get >>= \ a -> return $ browserCheckStatus a+setCheckStatus :: Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException) -> BrowserAction ()+setCheckStatus b = get >>= \ a -> put a {browserCheckStatus = b}+withCheckStatus :: Maybe (HT.Status -> HT.ResponseHeaders -> Maybe SomeException) -> BrowserAction a -> BrowserAction a+withCheckStatus a b = do+ current <- getCheckStatus+ setCheckStatus a+ out <- b+ setCheckStatus current return out -- | The active manager, managing the connection pool
http-conduit-browser.cabal view
@@ -1,9 +1,9 @@ name: http-conduit-browser-version: 1.6.2+version: 1.6.3 license: BSD3 license-file: LICENSE author: Myles C. Maxfield <myles.maxfield@gmail.com>-maintainer: Myles C. Maxfield <myles.maxfield@gmail.com>+maintainer: kudah <kudahkukarek@gmail.com> synopsis: Browser interface to the http-conduit package description: This package creates a monad representing things that browsers do,@@ -15,9 +15,13 @@ stability: Stable cabal-version: >= 1.8 build-type: Simple-homepage: https://github.com/litherum/http-conduit-browser extra-source-files: test/main.hs +homepage: https://github.com/exbb2/http-conduit-browser+source-repository head+ type: git+ location: git://github.com/exbb2/http-conduit-browser.git+ flag new-http-conduit default: True @@ -36,7 +40,7 @@ , containers , socks if flag(new-http-conduit)- build-depends: http-conduit >= 1.7 && < 1.8+ build-depends: http-conduit >= 1.7 && < 1.9 exposed-modules: Network.HTTP.Conduit.Browser else build-depends: http-conduit >= 1.6.1 && < 1.7@@ -73,7 +77,3 @@ , warp , wai , socks--source-repository head- type: git- location: git://github.com/litherum/http-conduit-browser.git