Hello community, here is the log from the commit of package ghc-HTTP for openSUSE:Factory checked in at 2015-06-30 10:18:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-HTTP (Old) and /work/SRC/openSUSE:Factory/.ghc-HTTP.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-HTTP" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-HTTP/ghc-HTTP.changes 2015-05-21 08:11:00.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-HTTP.new/ghc-HTTP.changes 2015-06-30 10:18:58.000000000 +0200 @@ -1,0 +2,19 @@ +Sun Jun 28 16:15:52 UTC 2015 - mimi...@gmail.com + +- update to 4000.2.20 +* If the URI contains "user:pass@" part, use it for Basic Authorization +* Add a test harness. +* Don't leak a socket when getHostAddr throws an exception. +* Send cookies in request format, not response format. +* Moved BrowserAction to be a StateT IO, with instances for + Applicative, MonadIO, MonadState. +* Add method to control size of connection pool. +* Consider both host and port when reusing connections. +* Handle response code 304 "not modified" properly. +* Fix digest authentication by fixing md5 output string rep. +* Make the default user agent string follow the package version. +* Document lack of HTTPS support and fail when clients try + to use it instead of silently falling back to HTTP. +* Add helper to set the request type and body. + +------------------------------------------------------------------- Old: ---- HTTP-4000.2.19.tar.gz _service New: ---- HTTP-4000.2.20.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-HTTP.spec ++++++ --- /var/tmp/diff_new_pack.VHOtAK/_old 2015-06-30 10:18:59.000000000 +0200 +++ /var/tmp/diff_new_pack.VHOtAK/_new 2015-06-30 10:18:59.000000000 +0200 @@ -19,7 +19,7 @@ %global pkg_name HTTP Name: ghc-HTTP -Version: 4000.2.19 +Version: 4000.2.20 Release: 0 Summary: A library for client-side HTTP License: BSD-3-Clause ++++++ HTTP-4000.2.19.tar.gz -> HTTP-4000.2.20.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.19/HTTP.cabal new/HTTP-4000.2.20/HTTP.cabal --- old/HTTP-4000.2.19/HTTP.cabal 2014-12-18 22:12:40.000000000 +0100 +++ new/HTTP-4000.2.20/HTTP.cabal 2015-06-21 19:17:52.000000000 +0200 @@ -1,5 +1,5 @@ Name: HTTP -Version: 4000.2.19 +Version: 4000.2.20 Cabal-Version: >= 1.8 Build-type: Simple License: BSD3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.19/Network/HTTP/Proxy.hs new/HTTP-4000.2.20/Network/HTTP/Proxy.hs --- old/HTTP-4000.2.19/Network/HTTP/Proxy.hs 2014-12-18 22:12:40.000000000 +0100 +++ new/HTTP-4000.2.20/Network/HTTP/Proxy.hs 2015-06-21 19:17:52.000000000 +0200 @@ -25,10 +25,11 @@ #endif -} -import Control.Monad ( when, mplus, join, liftM2) +import Control.Monad ( when, mplus, join, liftM, liftM2) #if defined(WIN32) import Network.HTTP.Base ( catchIO ) +import Data.List ( isPrefixOf ) #endif import Network.HTTP.Utils ( dropWhileTail, chopAtDelim ) import Network.HTTP.Auth @@ -75,12 +76,14 @@ -- Consults environment variable, and in case of Windows, by querying -- the Registry (cf. @registryProxyString@.) proxyString :: IO (Maybe String) -proxyString = liftM2 mplus envProxyString registryProxyString +proxyString = liftM2 mplus envProxyString windowsProxyString -registryProxyString :: IO (Maybe String) +windowsProxyString :: IO (Maybe String) #if !defined(WIN32) -registryProxyString = return Nothing +windowsProxyString = return Nothing #else +windowsProxyString = liftM (>>= parseWindowsProxy) registryProxyString + registryProxyLoc :: (HKEY,String) registryProxyLoc = (hive, path) where @@ -94,6 +97,7 @@ -- read proxy settings from the windows registry; this is just a best -- effort and may not work on all setups. +registryProxyString :: IO (Maybe String) registryProxyString = catchIO (bracket (uncurry regOpenKey registryProxyLoc) regCloseKey $ \hkey -> do enable <- fmap toBool $ regQueryValueDWORD hkey "ProxyEnable" @@ -101,6 +105,34 @@ then fmap Just $ regQueryValue hkey (Just "ProxyServer") else return Nothing) (\_ -> return Nothing) + +-- the proxy string is in the format "http=x.x.x.x:yyyy;https=...;ftp=...;socks=..." +-- even though the following article indicates otherwise +-- https://support.microsoft.com/en-us/kb/819961 +-- +-- to be sure, parse strings where each entry in the ';'-separated list above is +-- either in the format "protocol=..." or "protocol://..." +-- +-- only return the first "http" of them, if it exists +parseWindowsProxy :: String -> Maybe String +parseWindowsProxy s = + case proxies of + x:_ -> Just x + _ -> Nothing + where + parts = split ';' s + pr x = case break (== '=') x of + (p, []) -> p -- might be in format http:// + (p, u) -> p ++ "://" ++ drop 1 u + + proxies = filter (isPrefixOf "http://") . map pr $ parts + + split :: Eq a => a -> [a] -> [[a]] + split _ [] = [] + split a xs = case break (a ==) xs of + (ys, []) -> [ys] + (ys, _:zs) -> ys:split a zs + #endif -- | @fetchProxy flg@ gets the local proxy settings and parse the string @@ -115,7 +147,7 @@ case mstr of Nothing -> return NoProxy Just str -> case parseProxy str of - Just p -> return p + Just p -> return p Nothing -> do when warnIfIllformed $ System.IO.hPutStrLn System.IO.stderr $ unlines [ "invalid http proxy uri: " ++ show str diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTTP-4000.2.19/Network/TCP.hs new/HTTP-4000.2.20/Network/TCP.hs --- old/HTTP-4000.2.19/Network/TCP.hs 2014-12-18 22:12:40.000000000 +0100 +++ new/HTTP-4000.2.20/Network/TCP.hs 2015-06-21 19:17:52.000000000 +0200 @@ -10,8 +10,8 @@ -- Portability : non-portable (not tested) -- -- Some utility functions for working with the Haskell @network@ package. Mostly --- for internal use by the @Network.HTTP@ code, but --- +-- for internal use by the @Network.HTTP@ code. +-- ----------------------------------------------------------------------------- module Network.TCP ( Connection