aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorMichael Kaufmann <mail@michael-kaufmann.ch>2017-09-24 19:31:43 +0200
committerMichael Kaufmann <mail@michael-kaufmann.ch>2017-09-28 21:25:22 +0200
commiteac324f28420871b79790c8f2c3a3ec9bd0b9e00 (patch)
tree04630ef164072cd51087b26e1f19a261e0833da6 /lib/http.c
parent284d06df9e45a97043e6cf6c915d7eb15622c1e4 (diff)
http: add custom empty headers to repeated requests
Closes #1920
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index ea3e8af35..38227eb6c 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1626,12 +1626,12 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
else if(conn->bits.authneg &&
/* while doing auth neg, don't allow the custom length since
we will force length zero then */
- checkprefix("Content-Length", headers->data))
+ checkprefix("Content-Length:", headers->data))
;
else if(conn->allocptr.te &&
/* when asking for Transfer-Encoding, don't pass on a custom
Connection: */
- checkprefix("Connection", headers->data))
+ checkprefix("Connection:", headers->data))
;
else if((conn->httpversion == 20) &&
checkprefix("Transfer-Encoding:", headers->data))
@@ -1664,6 +1664,10 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
*ptr = ':';
result = Curl_add_bufferf(req_buffer, "%s\r\n",
headers->data);
+
+ /* restore the previous value */
+ *ptr = ';';
+
if(result)
return result;
}