curl / Mailing Lists / curl-library / Single Mail


Uncompress HTTP responses if no Accept-Encoding was sent?

From: Rainer Canavan <>
Date: Wed, 25 Apr 2018 13:10:17 +0200

Regarding the handling of the Accept-Encoding header field, states:

   A request without an Accept-Encoding header field implies that the
   user agent has no preferences regarding content-codings. Although
   this allows the server to use any content-coding in a response, it
   does not imply that the user agent will be able to correctly process
   all encodings.

I would conclude that libcurl should still try to decompress a
response with a supported Content-Encoding, however
Curl_http_readwrite_headers() explicitly checks if
data->set.str[STRING_ENCODING] was set (i.e. an Accept-Encoding header
was sent), and therefore disables compression.

I would simply remove that check for STRING_ENCODING. Opinions?

Received on 2018-04-25