Blame SOURCES/0028-curl-7.61.1-http-auth-payload.patch

1a95c1
From 5a51924c2505c1d5616904aa732fdaedd74d3ffe Mon Sep 17 00:00:00 2001
1a95c1
From: Marc Schlatter <mschlatter@gestour.com>
1a95c1
Date: Mon, 11 Mar 2019 17:15:34 +0100
1a95c1
Subject: [PATCH] http: send payload when (proxy) authentication is done
1a95c1
1a95c1
The check that prevents payload from sending in case of authentication
1a95c1
doesn't check properly if the authentication is done or not.
1a95c1
1a95c1
They're cases where the proxy respond "200 OK" before sending
1a95c1
authentication challenge. This change takes care of that.
1a95c1
1a95c1
Fixes #2431
1a95c1
Closes #3669
1a95c1
1a95c1
Upstream-commit: dd8a19f8a05b59394d1ab33c09497e8db884742a
1a95c1
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
1a95c1
---
1a95c1
 lib/http.c          | 3 ++-
1a95c1
 tests/data/test1097 | 5 +++--
1a95c1
 2 files changed, 5 insertions(+), 3 deletions(-)
1a95c1
1a95c1
diff --git a/lib/http.c b/lib/http.c
1a95c1
index e727ed8..26eb52d 100644
1a95c1
--- a/lib/http.c
1a95c1
+++ b/lib/http.c
1a95c1
@@ -1991,7 +1991,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
1a95c1
   if(result)
1a95c1
     return result;
1a95c1
 
1a95c1
-  if((data->state.authhost.multipass || data->state.authproxy.multipass) &&
1a95c1
+  if(((data->state.authhost.multipass && !data->state.authhost.done)
1a95c1
+      || (data->state.authproxy.multipass && !data->state.authproxy.done)) &&
1a95c1
      (httpreq != HTTPREQ_GET) &&
1a95c1
      (httpreq != HTTPREQ_HEAD)) {
1a95c1
     /* Auth is required and we are not authenticated yet. Make a PUT or POST
1a95c1
diff --git a/tests/data/test1097 b/tests/data/test1097
1a95c1
index 7512a2e..7eb7b5f 100644
1a95c1
--- a/tests/data/test1097
1a95c1
+++ b/tests/data/test1097
1a95c1
@@ -60,7 +60,7 @@ http://test.a.galaxy.far.far.away.1097:%HTTPPORT/1097 --proxy http://%HOSTIP:%HT
1a95c1
 <strip>
1a95c1
 ^User-Agent: curl/.*
1a95c1
 </strip>
1a95c1
-<protocol>
1a95c1
+<protocol nonewline="yes">
1a95c1
 CONNECT test.a.galaxy.far.far.away.1097:%HTTPPORT HTTP/1.1
1a95c1
 Host: test.a.galaxy.far.far.away.1097:%HTTPPORT
1a95c1
 Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
1a95c1
@@ -71,9 +71,10 @@ POST /1097 HTTP/1.1
1a95c1
 User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS OpenSSL/0.9.8g zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.12 libssh2/1.0.1_CVS
1a95c1
 Host: test.a.galaxy.far.far.away.1097:%HTTPPORT
1a95c1
 Accept: */*
1a95c1
-Content-Length: 0
1a95c1
+Content-Length: 11
1a95c1
 Content-Type: application/x-www-form-urlencoded
1a95c1
 
1a95c1
+dummy=value
1a95c1
 </protocol>
1a95c1
 
1a95c1
 </verify>
1a95c1
-- 
1a95c1
2.26.2
1a95c1