http-client 0.2.2.4 → 0.2.3
raw patch · 4 files changed
+20/−4 lines, 4 files
Files
- Network/HTTP/Client/Manager.hs +7/−3
- Network/HTTP/Client/Types.hs +1/−0
- http-client.cabal +1/−1
- test/Network/HTTP/ClientSpec.hs +11/−0
Network/HTTP/Client/Manager.hs view
@@ -324,9 +324,13 @@ getConn :: Request -> Manager -> IO (ConnRelease, Connection, ManagedConn)-getConn req m =- getManagedConn m (ConnKey connKeyHost connport (secure req)) $- go connaddr connhost connport+getConn req m+ -- Stop Mac OS X from getting high:+ -- https://github.com/snoyberg/http-client/issues/40#issuecomment-39117909+ | S8.null h = throwIO $ InvalidDestinationHost h+ | otherwise =+ getManagedConn m (ConnKey connKeyHost connport (secure req)) $+ go connaddr connhost connport where h = host req (useProxy, connhost, connport) = getConnDest req
Network/HTTP/Client/Types.hs view
@@ -103,6 +103,7 @@ -- -- Since 1.9.4 | IncompleteHeaders+ | InvalidDestinationHost S.ByteString deriving (Show, T.Typeable) instance Exception HttpException
http-client.cabal view
@@ -1,5 +1,5 @@ name: http-client-version: 0.2.2.4+version: 0.2.3 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
@@ -1,3 +1,4 @@+{-# LANGUAGE OverloadedStrings #-} module Network.HTTP.ClientSpec where import Network.HTTP.Client@@ -14,3 +15,13 @@ man <- newManager defaultManagerSettings res <- httpLbs req man responseStatus res `shouldBe` status200+ describe "fails on empty hostnames #40" $ do+ let test url = it url $ do+ req <- parseUrl url+ man <- newManager defaultManagerSettings+ _ <- httpLbs req man `shouldThrow` \e ->+ case e of+ InvalidDestinationHost "" -> True+ _ -> False+ return ()+ mapM_ test ["http://", "https://", "http://:8000", "https://:8001"]