I think curl is doing the right thing. If the compressed flag is set, then
curl has to decode the encoding itself. If the flag isn't set then curl
passes that responsibility to the calling application.

This allows applications to use curl as a transport.

On Thu, Oct 28, 2021, 07:15 Daniel Stenberg via curl-library <
[email protected]> wrote:

> 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
> > 'CURLE_BAD_CONTENT_ENCODING' error.
>
> It's not a known encoding to libcurl.
>
> >
> https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding>
> > 'identity' value "is always considered as acceptable, even if omitted."
>
> The better reference for the header is here:
> https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.2.2
>
> > Why doesn't curl treat the unknown encoding as identity if
> > CURLOPT_ACCEPT_ENCODING is set to ""?
>
> 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'.
>
> --
>
>   / daniel.haxx.se
>   | Commercial curl support up to 24x7 is available!
>   | Private help, bug fixes, support, ports, new features
>   | https://curl.se/support.html
> --
> Unsubscribe: https://lists.haxx.se/listinfo/curl-library
> Etiquette:   https://curl.haxx.se/mail/etiquette.html
>
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to