On Thu, May 28, 2020 at 10:18:58AM +0200, Olivier D wrote:
> Le jeu. 28 mai 2020 à 09:48, Willy Tarreau <[email protected]> a écrit :
> 
> > No you're not :-)  hdr_cnt() counts *values*. So :
> >
> >   Range: bytes=0-,0-,0-,0-
> >
> > decomposes as the following values around the comma delimiter:
> >
> >   "bytes=0-", "0-", "0-", "0-"
> >
> > And actually if you'd send several Range headers with such values they
> > could be remerged and interpreted as above. So in this case it's quite
> > convenient for us.
> >
> 
> My bad :(
> You made me realize I never used correctly this function. I was "counting"
> duplicate headers with it, and it worked because headers are merged and
> final behaviour matches what I was expecting.

If you need to count multiple occurrences of a given header field,
instead please use req.fhdr_cnt() which counts full headers (hence
consider any value as a single value and doesn't try to iterate
around commas).

> Thank you !

You're welcome :-)

Willy

Reply via email to