Hello community,
here is the log from the commit of package ghc-http-client for openSUSE:Factory
checked in at 2020-08-28 21:33:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-client (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-client.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-client"
Fri Aug 28 21:33:36 2020 rev:37 rq:829308 version:0.7.2.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-client/ghc-http-client.changes
2020-07-09 13:19:42.569334450 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-http-client.new.3399/ghc-http-client.changes
2020-08-28 21:33:37.116673789 +0200
@@ -1,0 +2,21 @@
+Mon Aug 24 02:00:37 UTC 2020 - [email protected]
+
+- Update http-client to version 0.7.2.1.
+ ## 0.7.2.1
+
+ * Fix bug in `useProxySecureWithoutConnect`.
+
+-------------------------------------------------------------------
+Fri Aug 21 11:18:56 UTC 2020 - [email protected]
+
+- Update http-client to version 0.7.2.
+ ## 0.7.2
+
+ * Add a new proxy mode, proxySecureWithoutConnect, for sending HTTPS
requests in plain text to a proxy without using the CONNECT method.
+
+-------------------------------------------------------------------
+Tue Aug 18 10:45:06 UTC 2020 - Peter Simons <[email protected]>
+
+- Replace %setup -q with the more modern %autosetup macro.
+
+-------------------------------------------------------------------
Old:
----
http-client-0.7.1.tar.gz
New:
----
http-client-0.7.2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-client.spec ++++++
--- /var/tmp/diff_new_pack.nq9Jb7/_old 2020-08-28 21:33:38.228674315 +0200
+++ /var/tmp/diff_new_pack.nq9Jb7/_new 2020-08-28 21:33:38.228674315 +0200
@@ -19,7 +19,7 @@
%global pkg_name http-client
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.7.1
+Version: 0.7.2.1
Release: 0
Summary: An HTTP client engine
License: MIT
@@ -70,7 +70,7 @@
This package provides the Haskell %{pkg_name} library development files.
%prep
-%setup -q -n %{pkg_name}-%{version}
+%autosetup -n %{pkg_name}-%{version}
%build
%ghc_lib_build
++++++ http-client-0.7.1.tar.gz -> http-client-0.7.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/ChangeLog.md
new/http-client-0.7.2.1/ChangeLog.md
--- old/http-client-0.7.1/ChangeLog.md 2020-06-18 13:40:14.000000000 +0200
+++ new/http-client-0.7.2.1/ChangeLog.md 2020-08-23 15:45:20.000000000
+0200
@@ -1,5 +1,13 @@
# Changelog for http-client
+## 0.7.2.1
+
+* Fix bug in `useProxySecureWithoutConnect`.
+
+## 0.7.2
+
+* Add a new proxy mode, proxySecureWithoutConnect, for sending HTTPS requests
in plain text to a proxy without using the CONNECT method.
+
## 0.7.1
* Remove `AI_ADDRCONFIG`
[#400](https://github.com/snoyberg/http-client/issues/400)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/Network/HTTP/Client/Headers.hs
new/http-client-0.7.2.1/Network/HTTP/Client/Headers.hs
--- old/http-client-0.7.1/Network/HTTP/Client/Headers.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/Network/HTTP/Client/Headers.hs 2020-08-19
19:38:36.000000000 +0200
@@ -12,7 +12,6 @@
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as S8
import qualified Data.CaseInsensitive as CI
-import Data.Char (ord)
import Data.Maybe (mapMaybe)
import Data.Monoid
import Network.HTTP.Client.Connection
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/Network/HTTP/Client/Manager.hs
new/http-client-0.7.2.1/Network/HTTP/Client/Manager.hs
--- old/http-client-0.7.1/Network/HTTP/Client/Manager.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/Network/HTTP/Client/Manager.hs 2020-08-23
15:44:12.000000000 +0200
@@ -17,6 +17,7 @@
, proxyEnvironmentNamed
, defaultProxy
, dropProxyAuthSecure
+ , useProxySecureWithoutConnect
) where
import qualified Data.ByteString.Char8 as S8
@@ -210,21 +211,23 @@
connkey = connKey req
connKey :: Request -> ConnKey
-connKey req =
- case proxy req of
- Nothing
- | secure req -> simple CKSecure
- | otherwise -> simple CKRaw
- Just p
- | secure req -> CKProxy
- (proxyHost p)
- (proxyPort p)
- (lookup "Proxy-Authorization" (requestHeaders req))
- (host req)
- (port req)
- | otherwise -> CKRaw Nothing (proxyHost p) (proxyPort p)
- where
- simple con = con (hostAddress req) (host req) (port req)
+connKey req@Request { proxy = Nothing, secure = False } =
+ CKRaw (hostAddress req) (host req) (port req)
+connKey req@Request { proxy = Nothing, secure = True } =
+ CKSecure (hostAddress req) (host req) (port req)
+connKey Request { proxy = Just p, secure = False } =
+ CKRaw Nothing (proxyHost p) (proxyPort p)
+connKey req@Request { proxy = Just p, secure = True,
+ proxySecureMode = ProxySecureWithConnect } =
+ CKProxy
+ (proxyHost p)
+ (proxyPort p)
+ (lookup "Proxy-Authorization" (requestHeaders req))
+ (host req)
+ (port req)
+connKey Request { proxy = Just p, secure = True,
+ proxySecureMode = ProxySecureWithoutConnect } =
+ CKRaw Nothing (proxyHost p) (proxyPort p)
mkCreateConnection :: ManagerSettings -> IO (ConnKey -> IO Connection)
mkCreateConnection ms = do
@@ -286,6 +289,15 @@
useProxy :: Proxy -> ProxyOverride
useProxy p = ProxyOverride $ const $ return $ \req -> req { proxy = Just p }
+-- | Send secure requests to the proxy in plain text rather than using CONNECT,
+-- regardless of the value in the @Request@.
+--
+-- @since 0.7.2
+useProxySecureWithoutConnect :: Proxy -> ProxyOverride
+useProxySecureWithoutConnect p = ProxyOverride $
+ const $ return $ \req -> req { proxy = Just p,
+ proxySecureMode = ProxySecureWithoutConnect }
+
-- | Get the proxy settings from the default environment variable (@http_proxy@
-- for insecure, @https_proxy@ for secure). If no variable is set, then fall
-- back to the given value. @Nothing@ is equivalent to 'noProxy', @Just@ is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/Network/HTTP/Client/Request.hs
new/http-client-0.7.2.1/Network/HTTP/Client/Request.hs
--- old/http-client-0.7.1/Network/HTTP/Client/Request.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/Network/HTTP/Client/Request.hs 2020-08-19
19:38:36.000000000 +0200
@@ -36,10 +36,11 @@
, observedStreamFile
, extractBasicAuthInfo
, throwErrorStatusCodes
+ , addProxySecureWithoutConnect
) where
import Data.Int (Int64)
-import Data.Maybe (fromMaybe, isJust, isNothing)
+import Data.Maybe (fromMaybe, isNothing)
import Data.Monoid (mempty, mappend, (<>))
import Data.String (IsString(..))
import Data.Char (toLower)
@@ -300,6 +301,7 @@
Nothing -> throwIO se
, requestManagerOverride = Nothing
, shouldStripHeaderOnRedirect = const False
+ , proxySecureMode = ProxySecureWithConnect
}
-- | Parses a URL via 'parseRequest_'
@@ -350,6 +352,13 @@
addProxy hst prt req =
req { proxy = Just $ Proxy hst prt }
+
+-- | Send secure requests to the proxy in plain text rather than using CONNECT.
+--
+-- @since 0.7.2
+addProxySecureWithoutConnect :: Request -> Request
+addProxySecureWithoutConnect req = req { proxySecureMode =
ProxySecureWithoutConnect }
+
-- | Add a Proxy-Authorization header (with the specified username and
-- password) to the given 'Request'. Ignore error handling:
--
@@ -465,10 +474,17 @@
| secure req = fromByteString "https://"
| otherwise = fromByteString "http://"
- requestHostname
- | isJust (proxy req) && not (secure req)
- = requestProtocol <> fromByteString hh
- | otherwise = mempty
+ requestHostname (Request { proxy = Nothing }) = mempty
+ requestHostname (Request { proxy = Just _,
+ secure = False }) =
+ requestProtocol <> fromByteString hh
+ requestHostname (Request { proxy = Just _,
+ secure = True,
+ proxySecureMode = ProxySecureWithConnect }) =
mempty
+ requestHostname (Request { proxy = Just _,
+ secure = True,
+ proxySecureMode = ProxySecureWithoutConnect }) =
+ requestProtocol <> fromByteString hh
contentLengthHeader (Just contentLength') =
if method req `elem` ["GET", "HEAD"] && contentLength' == 0
@@ -498,7 +514,7 @@
builder contentLength =
fromByteString (method req)
<> fromByteString " "
- <> requestHostname
+ <> requestHostname req
<> (case S8.uncons $ path req of
Just ('/', _) -> fromByteString $ path req
_ -> fromChar '/' <> fromByteString (path req))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/Network/HTTP/Client/Types.hs
new/http-client-0.7.2.1/Network/HTTP/Client/Types.hs
--- old/http-client-0.7.1/Network/HTTP/Client/Types.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/Network/HTTP/Client/Types.hs 2020-08-19
19:38:36.000000000 +0200
@@ -37,6 +37,7 @@
, ProxyOverride (..)
, StreamFileStatus (..)
, ResponseTimeout (..)
+ , ProxySecureMode (..)
) where
import qualified Data.Typeable as T (Typeable)
@@ -346,6 +347,15 @@
}
deriving (Show, Read, Eq, Ord, T.Typeable)
+-- | Define how to make secure connections using a proxy server.
+data ProxySecureMode =
+ ProxySecureWithConnect
+ -- ^ Use the HTTP CONNECT verb to forward a secure connection through the
proxy.
+ | ProxySecureWithoutConnect
+ -- ^ Send the request directly to the proxy with an https URL. This mode can
be
+ -- used to offload TLS handling to a trusted local proxy.
+ deriving (Show, Read, Eq, Ord, T.Typeable)
+
-- | When using one of the 'RequestBodyStream' \/ 'RequestBodyStreamChunked'
-- constructors, you must ensure that the 'GivesPopper' can be called multiple
-- times. Usually this is not a problem.
@@ -600,6 +610,13 @@
-- when following a redirect. Default: keep all headers intact.
--
-- @since 0.6.2
+
+ , proxySecureMode :: ProxySecureMode
+ -- ^ How to proxy an HTTPS request.
+ --
+ -- Default: Use HTTP CONNECT.
+ --
+ -- @since 0.7.2
}
deriving T.Typeable
@@ -633,6 +650,7 @@
, " redirectCount = " ++ show (redirectCount x)
, " responseTimeout = " ++ show (responseTimeout x)
, " requestVersion = " ++ show (requestVersion x)
+ , " proxySecureMode = " ++ show (proxySecureMode x)
, "}"
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/Network/HTTP/Client.hs
new/http-client-0.7.2.1/Network/HTTP/Client.hs
--- old/http-client-0.7.1/Network/HTTP/Client.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/Network/HTTP/Client.hs 2020-08-19
19:38:36.000000000 +0200
@@ -116,6 +116,7 @@
, proxyFromRequest
, noProxy
, useProxy
+ , useProxySecureWithoutConnect
, proxyEnvironment
, proxyEnvironmentNamed
, defaultProxy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/http-client.cabal
new/http-client-0.7.2.1/http-client.cabal
--- old/http-client-0.7.1/http-client.cabal 2020-06-18 13:39:42.000000000
+0200
+++ new/http-client-0.7.2.1/http-client.cabal 2020-08-23 15:44:35.000000000
+0200
@@ -1,5 +1,5 @@
name: http-client
-version: 0.7.1
+version: 0.7.2.1
synopsis: An HTTP client engine
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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.1/test/Network/HTTP/ClientSpec.hs
new/http-client-0.7.2.1/test/Network/HTTP/ClientSpec.hs
--- old/http-client-0.7.1/test/Network/HTTP/ClientSpec.hs 2020-06-18
13:36:44.000000000 +0200
+++ new/http-client-0.7.2.1/test/Network/HTTP/ClientSpec.hs 2020-08-16
16:20:39.000000000 +0200
@@ -35,13 +35,13 @@
responseStatus res `shouldBe` status405
describe "redirects" $ do
- it "follows redirects" $ do
+ xit "follows redirects" $ do
req <- parseRequest
"http://httpbin.org/redirect-to?url=http://httpbin.org"
man <- newManager defaultManagerSettings
res <- httpLbs req man
responseStatus res `shouldBe` status200
- it "allows to disable redirect following" $ do
+ xit "allows to disable redirect following" $ do
req <- (\ r -> r{ redirectCount = 0 }) <$>
parseRequest
"http://httpbin.org/redirect-to?url=http://httpbin.org"
man <- newManager defaultManagerSettings
@@ -88,7 +88,7 @@
man <- newManager settings
httpLbs "http://httpbin.org" man `shouldThrow` anyException
- it "redirectCount" $ do
+ xit "redirectCount" $ do
let modify req = return req { redirectCount = 0 }
settings = defaultManagerSettings { managerModifyRequest =
modify }
man <- newManager settings