Re: [PATCH] http: match headers case-insensitively when redacting
- From
Jeff King <peff@peff.net>
- Date
- Sep 21, 2021, 20:40 UTC
- Message-ID
- <YUpDRyfYN8gBcTOh@coredump.intra.peff.net>
- In-Reply-To
- <CAPUEspgrqxrhp-5diEenH+vevWi3QtxpjPqTwDuU5J-JHOXg9A@mail.gmail.com>
On Tue, Sep 21, 2021 at 01:14:21PM -0700, Carlo Arenas wrote:
Show 11 quoted lines
> On Tue, Sep 21, 2021 at 12:48 PM Jeff King <peff@peff.net> wrote: > > But certainly I found the behavior surprising. :) I'd guess it's because > > HTTP/2 is sending some binary goo instead of text headers, and the names > > we get are just coming from some lookup table? Or maybe I'm just showing > > my ignorance of HTTP/2. > > AFAIK headers in HTTP/2 MUST be lowercase as per the SPEC[1] > > Carlo > > [1] https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2
Yeah, I did some more reading and found that, too. From Daniel on StackOverflow, no less:
https://stackoverflow.com/questions/54067796/preserving-case-of-http-headers-with-curl
So it probably is reasonable to present them to the debug code in that way. It is a bit weird that we may see them differently depending on whether curl decided to use HTTP/1.1 or HTTP/2 under the hood, but matching the on-the-wire format is probably the least-bad thing.
-Peff