Hello community,

here is the log from the commit of package ghc-http-client for openSUSE:Factory 
checked in at 2015-07-16 17:18:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-07-08 06:59:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-http-client.new/ghc-http-client.changes     
2015-07-16 17:18:59.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Jul 13 05:40:57 UTC 2015 - [email protected]
+
+- update to 0.4.16
+* Proxy auth for HTTPS
+
+-------------------------------------------------------------------

Old:
----
  http-client-0.4.15.tar.gz

New:
----
  http-client-0.4.16.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-http-client.spec ++++++
--- /var/tmp/diff_new_pack.RurooL/_old  2015-07-16 17:19:00.000000000 +0200
+++ /var/tmp/diff_new_pack.RurooL/_new  2015-07-16 17:19:00.000000000 +0200
@@ -21,7 +21,7 @@
 %bcond_with tests
 
 Name:           ghc-http-client
-Version:        0.4.15
+Version:        0.4.16
 Release:        0
 Summary:        HTTP client engine, intended as a base layer 
 License:        MIT

++++++ http-client-0.4.15.tar.gz -> http-client-0.4.16.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-client-0.4.15/ChangeLog.md 
new/http-client-0.4.16/ChangeLog.md
--- old/http-client-0.4.15/ChangeLog.md 2015-07-02 17:35:06.000000000 +0200
+++ new/http-client-0.4.16/ChangeLog.md 2015-07-12 19:00:10.000000000 +0200
@@ -1,3 +1,7 @@
+## 0.4.16
+
+* Proxy auth for HTTPS 
[#132](https://github.com/snoyberg/http-client/issues/132)
+
 ## 0.4.15
 
 * Support proxy authentication in environment variables 
[#129](https://github.com/snoyberg/http-client/issues/129)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-client-0.4.15/Network/HTTP/Client/Core.hs 
new/http-client-0.4.16/Network/HTTP/Client/Core.hs
--- old/http-client-0.4.15/Network/HTTP/Client/Core.hs  2015-07-02 
17:35:06.000000000 +0200
+++ new/http-client-0.4.16/Network/HTTP/Client/Core.hs  2015-07-12 
19:00:10.000000000 +0200
@@ -89,7 +89,7 @@
     -- connections after accepting the request headers, so we need to check for
     -- exceptions in both.
     ex <- try $ do
-        cont <- requestBuilder req ci
+        cont <- requestBuilder (dropProxyAuthSecure req) ci
 
         getResponse connRelease timeout' req ci cont
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-client-0.4.15/Network/HTTP/Client/Manager.hs 
new/http-client-0.4.16/Network/HTTP/Client/Manager.hs
--- old/http-client-0.4.15/Network/HTTP/Client/Manager.hs       2015-07-02 
17:35:06.000000000 +0200
+++ new/http-client-0.4.16/Network/HTTP/Client/Manager.hs       2015-07-12 
19:00:10.000000000 +0200
@@ -19,6 +19,7 @@
     , proxyEnvironment
     , proxyEnvironmentNamed
     , defaultProxy
+    , dropProxyAuthSecure
     ) where
 
 #if !MIN_VERSION_base(4,6,0)
@@ -385,6 +386,18 @@
         Just p -> (True, S8.unpack (proxyHost p), proxyPort p)
         Nothing -> (False, S8.unpack $ host req, port req)
 
+-- | Drop the Proxy-Authorization header from the request if we're using a
+-- secure proxy.
+dropProxyAuthSecure :: Request -> Request
+dropProxyAuthSecure req
+    | secure req && useProxy = req
+        { requestHeaders = filter (\(k, _) -> k /= "Proxy-Authorization")
+                                  (requestHeaders req)
+        }
+    | otherwise = req
+  where
+    (useProxy, _, _) = getConnDest req
+
 getConn :: Request
         -> Manager
         -> IO (ConnRelease, Connection, ManagedConn)
@@ -413,12 +426,15 @@
             (True, True) ->
                 let ultHost = host req
                     ultPort = port req
+                    proxyAuthorizationHeader = maybe "" (\h -> S8.concat 
["Proxy-Authorization: ", h, "\r\n"]) . lookup "Proxy-Authorization" $ 
requestHeaders req
                     connstr = S8.concat
                         [ "CONNECT "
                         , ultHost
                         , ":"
                         , S8.pack $ show ultPort
-                        , " HTTP/1.1\r\n\r\n"
+                        , " HTTP/1.1\r\n"
+                        , proxyAuthorizationHeader
+                        , "\r\n"
                         ]
                     parse conn = do
                         sh@(StatusHeaders status _ _) <- parseStatusHeaders 
conn Nothing Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-client-0.4.15/http-client.cabal 
new/http-client-0.4.16/http-client.cabal
--- old/http-client-0.4.15/http-client.cabal    2015-07-02 17:35:06.000000000 
+0200
+++ new/http-client-0.4.16/http-client.cabal    2015-07-12 19:00:10.000000000 
+0200
@@ -1,5 +1,5 @@
 name:                http-client
-version:             0.4.15
+version:             0.4.16
 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


Reply via email to