News for hackers. Stuff that matters.
Re:Zig 0.9.0 by lmm on Monday December 20, 2021 @09:05PM (#29632960)
The HTTP specification does tell you to behave differently depending on the presence or absence of specific values for case-insensitive headers. That requires decoding the header name strings.
Re:Zig 0.9.0 by coldtea on Tuesday December 21, 2021 @03:27AM (#29635224)
>That requires decoding the header name strings.

Which should be ascii though no?

Re:Zig 0.9.0 by lmm on Tuesday December 21, 2021 @03:31AM (#29635248)
Maybe, but it's not "treating strings as opaque encoded bytes" which is what was asked.
Re:Zig 0.9.0 by lhorie on Tuesday December 21, 2021 @12:58PM (#29640103)
ASCII is kinda special in that it's both a way of encoding strings and it has character-to-byte equivalence. You can specify an HTTP header as being any number of characters between `\n\r` characters or any number of bytes between `0x0A 0x0D`, and the parsing code is going to compile to pretty much the same thing regardless of whether you know what `0x0A` means or not.
Re:Zig 0.9.0 by lmm on Tuesday December 21, 2021 @07:36PM (#29644016)
Right, but to do case-insensitive comparisons of header names you need to decode them as strings, not just byte sequences.