curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Applying decompression by default when content-encoding header is set

From: Daniel Stenberg via curl-users <curl-users_at_cool.haxx.se>
Date: Fri, 18 Jun 2021 09:20:35 +0200 (CEST)

On Fri, 18 Jun 2021, Marcus Hoffmann via curl-users wrote:

> curl already detects when it's printing to a terminal (and then refuses to
> print binary output). Any chance at making auto-decompression dependent on
> that as well? I guess that has a far lesser chance of breaking anyones
> scripts.

Why? curl can't automatically tell if the user wanted to download the
compressed content or show the content decompressed. It could possibly do a
better guess based on Content-Type but that would make it very unpredictable
for users.

The main problem I would say is actually that HTTP is slightly abused in this
case. The Content-Encoding was never designed to get used for automatic
decompression in transit, HTTP added Transfer-Encoding for that but it was
never used by the browsers so the Content-Encoding hack won.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://www.wolfssl.com/contact/
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-06-18