curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Incorrect documentation of CURLOPT_HEADERFUNCTION

From: Guido Berhoerster <guido+haxx.se_at_berhoerster.name>
Date: Fri, 16 Feb 2018 11:12:55 +0100

* Daniel Stenberg <daniel_at_haxx.se> [2018-02-16 09:55]:
> On Fri, 16 Feb 2018, Guido Berhoerster wrote:
>
>> One more issue I ran into when dealing with response headers is that "only
>> complete header lines are passed on to the callback" does not hold true for
>> folded headers. While RFC7230 does deprecate them, it also requires clients
>> to accept and normalize them before interpretation. I don't know wheter you
>> consider that to be in scope for (lib)curl, if not, it would be good to
>> mention this in the CURLOPT_HEADERFUNCTION documentation.
>
> So what happens when libcurl gets one?

Then the callback does not get a complete header and it's up to the
libcurl consumer to merge it with the previous header. Which is
fine, since one usually needs to do other normalization as well,
it's just not obvious from the documentation.

> They're deprecated in 7230 since they are and were virtually unused. I don't
> think adding support for them now makes much sense since we've managed pretty
> good without them for decades!

-- 
Guido Berhoerster
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-02-16