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: Dan Fandrich via curl-users <>
Date: Thu, 17 Jun 2021 15:11:11 -0700

On Thu, Jun 17, 2021 at 09:56:47PM +0200, Marcus Hoffmann via curl-users wrote:
> today I interacted with an API that applied gzip encoding by default to
> responses, which after reading
> I think is valid
> behaviour.
> I was surprised that curl didn't decompress the response automatically
> without adding the `--compressed` flag.
> That was easy enough to find in the man page, but is there any reason for
> curl not acting upon the `content-encoding` header automatically?

Enabling it automatically probably would have been a good default at the start,
but the current behaviour has been that way for over 10 years so changing it
now likely means breaking all kinds of scripts. You can always enable it by
default in your .curlrc file.

Received on 2021-06-18