From eac324f28420871b79790c8f2c3a3ec9bd0b9e00 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 24 Sep 2017 19:31:43 +0200 Subject: http: add custom empty headers to repeated requests Closes #1920 --- lib/http.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/http.c') 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; } -- cgit v1.2.3