From 2646af106b04480fa5b063625deb5feb25c8df65 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 Aug 2004 13:25:30 +0000 Subject: allow a custom "Accept-Encoding:" header override the internally set one that gets set with CURLOPT_ENCODING --- lib/http.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/http.c') diff --git a/lib/http.c b/lib/http.c index 567d16dd2..07354a1c4 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1325,6 +1325,15 @@ CURLcode Curl_http(struct connectdata *conn) if(data->set.cookie && !checkheaders(data, "Cookie:")) addcookies = data->set.cookie; + if(!checkheaders(data, "Accept-Encoding:") && + data->set.encoding) { + Curl_safefree(conn->allocptr.accept_encoding); + conn->allocptr.accept_encoding = + aprintf("Accept-Encoding: %s\015\012", data->set.encoding); + if(!conn->allocptr.accept_encoding) + return CURLE_OUT_OF_MEMORY; + } + if(!conn->bits.upload_chunky && (httpreq != HTTPREQ_GET)) { /* not a chunky transfer yet, but data is to be sent */ ptr = checkheaders(data, "Transfer-Encoding:"); -- cgit v1.2.3