cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl might not be decompressing the body if the server sends it compressed without being asked to do so

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 1 Jul 2016 22:53:28 +0200

On Fri, Jul 01, 2016 at 09:52:07PM +0200, Daniel Stenberg wrote:
> On Fri, 1 Jul 2016, Attila-Mihaly Balazs wrote:
>
> >I can't reliably reproduce this, but I think that if the server sends the
> >response compressed (ie. "Content-Encoding: gzip") without curl asking for
> >this (ie. the "--compressed" flag was not specified), curl doesn't
> >decompress the body.
>
> Correct, and it never has. "Content-Encoding: gzip" is in fact just a signal
> from the server that the data is compressed, it isn't telling the user-agent
> to automatically decompress it - even if it has turned out to become that a
> lot of the time...
>
> So it is by design. Maybe we should reconsider that design decision...

If I want to download a compressed tarball (for example) I don't want curl
uncompressing it behind my back without my asking for it. If I do want it
uncompressed, I'll give it the --compressed option. There may be an argument to
make --compressed the default so a tarball download would need --no-compressed
to be given, but that's a pretty big compatibility break.

>>> Dan

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-07-01