Re: [whatwg/fetch] "get, decode, and split a header value" algorithm appears to choke on malformed values (Issue #1778)

I have the feeling you skipped step 5.2.2? At least the way I read https://fetch.spec.whatwg.org/#header-value-get-decode-and-split is that once you see the first `"` and collect `"a"` (appending `a` to _temporaryValue_), _position_ is not past the end of _input_, so you go back to the start of the while loop. Then you append nothing to _temporaryValue_ as you're looking at `"` so then you collect `"b"` (appending `b` to _temporaryValue_). And only then do you start trimming whitespace.

I also double checked with the changes we recently made in #1769 and I don't think they regressed something, so if there is some kind of error here (and it does seem like we don't match browsers and maybe ought to do something with this), it's a novel one.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1778#issuecomment-2379208178
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1778/2379208178@github.com>

Received on Friday, 27 September 2024 12:50:23 UTC