http-client-restricted 0.0.4 → 0.0.5
raw patch · 3 files changed
+16/−6 lines, 3 filesdep ~http-clientdep ~http-client-tlsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: http-client, http-client-tls
API changes (from Hackage documentation)
Files
- CHANGELOG +9/−0
- Network/HTTP/Client/Restricted.hs +4/−3
- http-client-restricted.cabal +3/−3
CHANGELOG view
@@ -1,3 +1,12 @@+http-client-restricted (0.0.5) unstable; urgency=medium++ * Deal with raw IPv6 addresses correctly, stripping square+ brackets before passing on to name resolution. + (The same fix was made in http-client 0.7.11, which this depends on.)+ Thanks, Robert Vollmert.++ -- Joey Hess <id@joeyh.name> Wed, 09 Feb 2022 11:24:29 -0400+ http-client-restricted (0.0.4) unstable; urgency=medium * Update to http-client 0.7.
Network/HTTP/Client/Restricted.hs view
@@ -247,7 +247,7 @@ where go context h p = do let connparams = NC.ConnectionParams- { NC.connectionHostname = h+ { NC.connectionHostname = hstripped , NC.connectionPort = fromIntegral p , NC.connectionUseSecure = tls , NC.connectionUseSocks = Nothing -- unsupprted@@ -259,19 +259,20 @@ , addrProtocol = proto , addrSocketType = Stream }- addrs <- getAddrInfo (Just hints) (Just h) (Just serv)+ addrs <- getAddrInfo (Just hints) (Just hstripped) (Just serv) bracketOnError (firstSuccessful $ map tryToConnect addrs) close (\sock -> NC.connectFromSocket context sock connparams) where+ hstripped = strippedHostName h -- strip brackets of raw IPv6 hosts tryToConnect addr = case checkAddressRestriction cfg addr of Nothing -> bracketOnError (socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)) close (\sock -> connect sock (addrAddress addr) >> return sock) Just r -> throwIO r- firstSuccessful [] = throwIO $ NC.HostNotResolved h+ firstSuccessful [] = throwIO $ NC.HostNotResolved hstripped firstSuccessful (a:as) = a `catch` \(e ::IOException) -> case as of [] -> throwIO e
http-client-restricted.cabal view
@@ -1,5 +1,5 @@ Name: http-client-restricted-Version: 0.0.4+Version: 0.0.5 Cabal-Version: >= 1.10 Maintainer: Joey Hess <id@joeyh.name> Author: Joey Hess@@ -27,8 +27,8 @@ Network.HTTP.Client.Restricted Build-Depends: base >= 4.11.1.0 && < 5.0- , http-client >= 0.7 && < 0.8- , http-client-tls >= 0.3.2 && < 0.4+ , http-client >= 0.7.11 && < 0.8+ , http-client-tls >= 0.3.6 && < 0.4 , connection >= 0.2.5 , data-default , network (>= 3.0.0.0)