http-client 0.4.28 → 0.4.29
raw patch · 10 files changed
+28/−11 lines, 10 files
Files
- ChangeLog.md +7/−0
- Network/HTTP/Client.hs +1/−0
- Network/HTTP/Client/Connection.hs +2/−2
- Network/HTTP/Client/Cookies.hs +1/−1
- Network/HTTP/Client/Core.hs +1/−2
- Network/HTTP/Client/Headers.hs +4/−4
- Network/HTTP/Client/Manager.hs +2/−0
- Network/HTTP/Client/Request.hs +8/−0
- http-client.cabal +1/−1
- publicsuffixlist/Network/PublicSuffixList/Serialize.hs +1/−1
ChangeLog.md view
@@ -1,3 +1,10 @@+## 0.4.29++* Changed the order of connecting a socket and tweaking a socket, such that the socket tweaking callback now happen before connecting.+* add setRequestIgnoreStatus [#201](https://github.com/snoyberg/http-client/pull/201)+* Added missing Host: HTTP header for https CONNECT [#192](https://github.com/snoyberg/http-client/pull/192)+* Fix: Redirects will be followed in httpRaw' when reusing a dead connection [#195](https://github.com/snoyberg/http-client/issues/195)+ ## 0.4.28 * Add support for including request method in URL
Network/HTTP/Client.hs view
@@ -132,6 +132,7 @@ , applyBasicAuth , urlEncodedBody , getUri+ , setRequestIgnoreStatus , setQueryString -- ** Request type and fields , Request
Network/HTTP/Client/Connection.hs view
@@ -41,7 +41,7 @@ go bs0 id 0 where go bs front total =- case S.breakByte charLF bs of+ case S.break (== charLF) bs of (_, "") -> do let total' = total + S.length bs when (total' > 4096) $ throwIO OverlongHeaders@@ -165,8 +165,8 @@ (NS.sClose) (\sock -> do NS.setSocketOption sock NS.NoDelay 1- NS.connect sock (NS.addrAddress addr) tweakSocket sock+ NS.connect sock (NS.addrAddress addr) socketConnection sock chunksize) firstSuccessful :: [NS.AddrInfo] -> (NS.AddrInfo -> IO a) -> IO a
Network/HTTP/Client/Cookies.hs view
@@ -47,7 +47,7 @@ Just (i, x') | BS.null x' && i >= 0 && i < 256 -> go (rest - 1) y _ -> False where- (x, y') = BS.breakByte 46 bs -- period+ (x, y') = BS.break (== 46) bs -- period y = BS.drop 1 y' -- | This corresponds to the subcomponent algorithm entitled \"Domain Matching\" detailed
Network/HTTP/Client/Core.hs view
@@ -113,8 +113,7 @@ -- Connection was reused, and might have been closed. Try again (Left e, Reused) | mRetryableException m e -> do connRelease DontReuse- res <- responseOpen req m- return (req, res)+ httpRaw' req m -- Not reused, or a non-retry, so this is a real exception (Left e, _) -> throwIO e -- Everything went ok, so the connection is good. If any exceptions get
Network/HTTP/Client/Headers.hs view
@@ -61,8 +61,8 @@ parseStatus :: Int -> S.ByteString -> IO (Status, HttpVersion) parseStatus i bs | S.null bs && i > 0 = connectionReadLine conn >>= parseStatus (i - 1) parseStatus _ bs = do- let (ver, bs2) = S.breakByte charSpace bs- (code, bs3) = S.breakByte charSpace $ S.dropWhile (== charSpace) bs2+ let (ver, bs2) = S.break (== charSpace) bs+ (code, bs3) = S.break (== charSpace) $ S.dropWhile (== charSpace) bs2 msg = S.dropWhile (== charSpace) bs3 case (,) <$> parseVersion ver <*> readInt code of Just (ver', code') -> return (Status code' msg, ver')@@ -73,7 +73,7 @@ | otherwise = Nothing parseVersion bs0 = do bs1 <- stripPrefixBS "HTTP/" bs0- let (num1, S.drop 1 -> num2) = S.breakByte charPeriod bs1+ let (num1, S.drop 1 -> num2) = S.break (== charPeriod) bs1 HttpVersion <$> readInt num1 <*> readInt num2 readInt bs =@@ -92,7 +92,7 @@ parseHeader :: S.ByteString -> IO Header parseHeader bs = do- let (key, bs2) = S.breakByte charColon bs+ let (key, bs2) = S.break (== charColon) bs when (S.null bs2) $ throwIO $ InvalidHeader bs return (CI.mk $! strip key, strip $! S.drop 1 bs2)
Network/HTTP/Client/Manager.hs view
@@ -434,6 +434,7 @@ let ultHost = host req ultPort = port req proxyAuthorizationHeader = maybe "" (\h -> S8.concat ["Proxy-Authorization: ", h, "\r\n"]) . lookup "Proxy-Authorization" $ requestHeaders req+ hostHeader = S8.concat ["Host: ", ultHost, (S8.pack $ show ultPort), "\r\n"] connstr = S8.concat [ "CONNECT " , ultHost@@ -441,6 +442,7 @@ , S8.pack $ show ultPort , " HTTP/1.1\r\n" , proxyAuthorizationHeader+ , hostHeader , "\r\n" ] parse conn = do
Network/HTTP/Client/Request.hs view
@@ -20,6 +20,7 @@ , needsGunzip , requestBuilder , useDefaultTimeout+ , setRequestIgnoreStatus , setQueryString , streamFile , observedStreamFile@@ -468,6 +469,13 @@ <> fromByteString ": " <> fromByteString v <> fromByteString "\r\n"++-- | Modify the request so that non-2XX status codes do not generate a runtime+-- 'StatusCodeException'.+--+-- @since 0.4.29+setRequestIgnoreStatus :: Request -> Request+setRequestIgnoreStatus req = req { checkStatus = \_ _ _ -> Nothing } -- | Set the query string to the given key/value pairs. --
http-client.cabal view
@@ -1,5 +1,5 @@ name: http-client-version: 0.4.28+version: 0.4.29 synopsis: An HTTP client engine, intended as a base layer for more user-friendly packages. description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/http-client>. homepage: https://github.com/snoyberg/http-client
publicsuffixlist/Network/PublicSuffixList/Serialize.hs view
@@ -35,7 +35,7 @@ getText bs0 = (TE.decodeUtf8 v, BS.drop 1 bs1) where- (v, bs1) = BS.breakByte 0 bs0+ (v, bs1) = BS.break (== 0) bs0 getDataStructure :: BS.ByteString -> DataStructure getDataStructure bs0 =