curl / Mailing Lists / curl-library / Single Mail

curl-library

Uncompress HTTP responses if no Accept-Encoding was sent?

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

Regarding the handling of the Accept-Encoding header field,
https://tools.ietf.org/html/rfc7231#section-5.3.4 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?

rainer
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-04-25