![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package ghc-http-client for openSUSE:Factory checked in at 2015-09-02 00:36:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-http-client (Old) and /work/SRC/openSUSE:Factory/.ghc-http-client.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-http-client" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-http-client/ghc-http-client.changes 2015-08-25 08:48:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-http-client.new/ghc-http-client.changes 2015-09-02 00:36:09.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Aug 31 08:04:52 UTC 2015 - mimi.vx@gmail.com + +- update to 0.4.21 +* Support no_proxy environment variable + +------------------------------------------------------------------- Old: ---- http-client-0.4.20.tar.gz New: ---- http-client-0.4.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-http-client.spec ++++++ --- /var/tmp/diff_new_pack.JAvGTh/_old 2015-09-02 00:36:10.000000000 +0200 +++ /var/tmp/diff_new_pack.JAvGTh/_new 2015-09-02 00:36:10.000000000 +0200 @@ -21,7 +21,7 @@ %bcond_with tests Name: ghc-http-client -Version: 0.4.20 +Version: 0.4.21 Release: 0 Summary: HTTP client engine, intended as a base layer License: MIT ++++++ http-client-0.4.20.tar.gz -> http-client-0.4.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.20/ChangeLog.md new/http-client-0.4.21/ChangeLog.md --- old/http-client-0.4.20/ChangeLog.md 2015-08-18 10:29:13.000000000 +0200 +++ new/http-client-0.4.21/ChangeLog.md 2015-08-28 06:45:12.000000000 +0200 @@ -1,3 +1,7 @@ +## 0.4.21 + +* Support `no_proxy` environment variable. [#140](https://github.com/snoyberg/http-client/issues/140) [#145](https://github.com/snoyberg/http-client/pull/145) + ## 0.4.20 * Expose `brReadSome` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.20/Network/HTTP/Client/Manager.hs new/http-client-0.4.21/Network/HTTP/Client/Manager.hs --- old/http-client-0.4.20/Network/HTTP/Client/Manager.hs 2015-08-18 10:29:13.000000000 +0200 +++ new/http-client-0.4.21/Network/HTTP/Client/Manager.hs 2015-08-28 06:45:12.000000000 +0200 @@ -37,6 +37,7 @@ import qualified Blaze.ByteString.Builder as Blaze +import Data.Char (toLower) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Read (decimal) @@ -506,7 +507,9 @@ envHelper name eh = do env <- getEnvironment let lenv = Map.fromList $ map (first $ T.toLower . T.pack) env - case lookup (T.unpack name) env <|> Map.lookup name lenv of + lookupEnvVar n = lookup (T.unpack n) env <|> Map.lookup n lenv + noProxyDomains = domainSuffixes (lookupEnvVar "no_proxy") + case lookupEnvVar name of Nothing -> return noEnvProxy Just "" -> return noEnvProxy Just str -> do @@ -541,9 +544,17 @@ Just $ (Proxy (S8.pack $ U.uriRegName auth) port, muserpass) return $ \req -> - maybe id (uncurry applyBasicProxyAuth) muserpass - req { proxy = Just p } + if host req `hasDomainSuffixIn` noProxyDomains + then noEnvProxy req + else maybe id (uncurry applyBasicProxyAuth) muserpass + req { proxy = Just p } where noEnvProxy = case eh of EHFromRequest -> id EHNoProxy -> \req -> req { proxy = Nothing } EHUseProxy p -> \req -> req { proxy = Just p } + prefixed s | S8.head s == '.' = s + | otherwise = S8.cons '.' s + domainSuffixes Nothing = [] + domainSuffixes (Just "") = [] + domainSuffixes (Just no_proxy) = [prefixed $ S8.dropWhile (== ' ') suffix | suffix <- S8.split ',' (S8.pack (map toLower no_proxy)), not (S8.null suffix)] + hasDomainSuffixIn host = any (`S8.isSuffixOf` prefixed (S8.map toLower host)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/http-client-0.4.20/http-client.cabal new/http-client-0.4.21/http-client.cabal --- old/http-client-0.4.20/http-client.cabal 2015-08-18 10:29:13.000000000 +0200 +++ new/http-client-0.4.21/http-client.cabal 2015-08-28 06:45:12.000000000 +0200 @@ -1,5 +1,5 @@ name: http-client -version: 0.4.20 +version: 0.4.21 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