curl / Mailing Lists / curl-library / 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: Unknown Content-Encoding value and zero-lenght string CURLOPT_ACCEPT_ENCODING

From: Daniel Stenberg via curl-library <>
Date: Thu, 28 Oct 2021 13:15:20 +0200 (CEST)

On Thu, 28 Oct 2021, Fujii Hironori via curl-library wrote:

> Monaco Editor Samples is using their own HTTP server 'yaserver' which sends
> an invalid 'Content-Encoding: utf8' header.

Shouldn't you then report this as an error against yaserver?

> However, if I invoke curl commnad with '--compressed' switch, it reports

It's not a known encoding to libcurl.

> 'identity' value "is always considered as acceptable, even if omitted."

The better reference for the header is here:

> Why doesn't curl treat the unknown encoding as identity if

I don't think that's what it says we should do, because that would then also
pass on contents compressed with other algorithm than what curl supports etc.

But I understand what you're asking for. Maybe we should provide a way to tell
libcurl "when no matching encoding is found, pretend it was identity". Of
course that will then risk passing on complete garbage at times.

> Should WinCairo set the CURLOPT_ACCEPT_ENCODING explicitly to the following
> instead of "" ?
>> curl_easy_setopt(m_handle, CURLOPT_ACCEPT_ENCODING, "identity, deflate,
> gzip, br");

That list still doesn't include 'utf8'.

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2021-10-28