llhttp
llhttp copied to clipboard
improve codebase, fix QDTEXT lookup table
Actually started as improve codebase branch. It seems that there is mistake in the lookup table for QDTEXT, which is in main called QUOTED_STRING.
export const QUOTED_STRING: CharList = [ '\t', ' ' ];
for (let i = 0x21; i <= 0xff; i++) {
if (i !== 0x22 && i !== 0x5c) { // All characters in ASCII except \ and "
QUOTED_STRING.push(i);
}
}
The generated Lookup Table in main contains also 0x7F, which is not a valid char of QDTEXT.
https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.4
I guess, we actually can extract all the lookup table code into a separate file, because we dont need that lookup data in nodejs or undici, in contrast to error code and stuff.