http-conduit 1.4.1.8 → 1.4.1.9
raw patch · 4 files changed
+32/−15 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/HTTP/Conduit.hs +16/−0
- Network/HTTP/Conduit/Request.hs +5/−4
- Network/HTTP/Conduit/Response.hs +10/−10
- http-conduit.cabal +1/−1
Network/HTTP/Conduit.hs view
@@ -49,6 +49,22 @@ -- > $ simpleHttp "http://www.haskell.org/" >>= L.putStr -- > -- > Cookies are implemented according to RFC 6265.+--+-- Note that by default, the functions in this package will throw exceptions+-- for non-2xx status codes. If you would like to avoid this, you should use+-- 'checkStatus', e.g.:+--+-- > import Data.Conduit.Binary (sinkFile)+-- > import Network.HTTP.Conduit+-- > import qualified Data.Conduit as C+-- > import Network+-- >+-- > main :: IO ()+-- > main = withSocketsDo $ do+-- > request' <- parseUrl "http://www.yesodweb.com/does-not-exist"+-- > let request = request' { checkStatus = \_ _ -> Nothing }+-- > res <- withManager $ httpLbs request+-- > print res module Network.HTTP.Conduit ( -- * Perform a request simpleHttp
Network/HTTP/Conduit/Request.hs view
@@ -331,10 +331,11 @@ <> fromByteString " " <> (case S8.uncons $ path req of Just ('/', _) -> fromByteString $ path req- _ -> fromByteString "/" <> fromByteString (path req))- <> (if S8.null (queryString req)- then mempty- else fromChar '?' <> fromByteString (queryString req))+ _ -> fromChar '/' <> fromByteString (path req))+ <> (case S8.uncons $ queryString req of+ Nothing -> mempty+ Just ('?', _) -> fromByteString $ queryString req+ _ -> fromChar '?' <> fromByteString (queryString req)) <> fromByteString " HTTP/1.1\r\n" <> foldr (\a b -> headerPairToBuilder a <> b)
Network/HTTP/Conduit/Response.hs view
@@ -75,16 +75,16 @@ | 300 <= code && code < 400 = do l' <- lookup "location" hs req' <- setUriRelative req =<< parseURIReference (S8.unpack l')- return req'- { method =- -- According to the spec, this should *only* be for- -- status code 303. However, almost all clients- -- mistakenly implement it for 302 as well. So we- -- have to be wrong like everyone else...- if code == 302 || code == 303- then "GET"- else method req'- }+ return $+ if code == 302 || code == 303+ -- According to the spec, this should *only* be for status code+ -- 303. However, almost all clients mistakenly implement it for+ -- 302 as well. So we have to be wrong like everyone else...+ then req'+ { method = "GET"+ , requestBody = RequestBodyBS ""+ }+ else req' | otherwise = Nothing -- | Convert a 'Response' that has a 'C.Source' body to one with a lazy
http-conduit.cabal view
@@ -1,5 +1,5 @@ name: http-conduit-version: 1.4.1.8+version: 1.4.1.9 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>