Closed thynson closed 10 months ago
Good catch, will take a look at your PR when I have some time.
Actually this is ok, as header names (not values) can only contain A-Z, a-z, 0–9, hyphen ( - ), or underscore ( _ )
Yeah, I didn't read the spec seriously, but for key decoding it has been ensured at the first time that each byte must be a 7bit ASCII at the first time. For only value decoding it should be done in this way.
https://github.com/tim-smart/multipasta/blob/451de6a06ee4b1d05b5b6903e84ce97b0a277a19/src/internal/headers.ts#L88
Text decoding should only be done when the whole buffer of
key
orvalue
was available, so multi-byte character that being splitted into different chunks can be properly decoded.