-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define the Content-Type header parser #831
Conversation
Also known as "extract a MIME type" down right. Tests: web-platform-tests/wpt#10525. Helps with #814. Fixes #529. Closes whatwg/mimesniff#30.
e259098
to
a28d42c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some clarity suggestions. Very exciting stuff.
Oh, also, should the new |
My plan was that we use the algorithm for |
This aligns with the changes made in whatwg/fetch#831. Fortunately the remainder of the prose already assumed it got a MIME type record rather than bytes.
@MattMenke2 @bzbarsky any final thoughts here? I realize this doesn't match browsers 100% due to eager combining, but it feels like the only sensible model to specify given that intermediaries are allowed to combine. Hopefully given enough time browsers can converge on this model. And if they can't, we can revisit… |
I don't really understand this space well enough at this point to comment intelligently... |
@MattMenke2 I created an algorithm for collecting an HTTP quoted string based on the MIME type parser (and also created whatwg/mimesniff#92 to use it there). It's a little ugly as here we care about moving the position only whereas in the MIME type parser we also care about extracting a value, but this seemed like a reasonable compromise that would not lead to code duplication. (I'd be open to changing the algorithm to take a boolean to return one or the other value in the end, rather than both.) |
There's now additional tests for escaped quotes as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks pretty good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great, thanks for all the iteration! Only a couple minor suggestions.
See whatwg/fetch#831 for context.
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525
This aligns with the changes made in whatwg/fetch#831. Fortunately the remainder of the prose already assumed it got a MIME type record rather than bytes.
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: f49a14324463677b56f2a95835bb072c6bd9e378
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: 3654829da79864d0ca79d12ef226c2cb3a45729f
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: f49a14324463677b56f2a95835bb072c6bd9e378
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: 3654829da79864d0ca79d12ef226c2cb3a45729f
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: f49a14324463677b56f2a95835bb072c6bd9e378
Automatic update from web-platform-tests Fetch: Content-Type parsing See whatwg/fetch#831 for context. -- wpt-commits: 62317fb983ca5687e4133d89f5523839fdab7f69 wpt-pr: 10525 UltraBlame original commit: 3654829da79864d0ca79d12ef226c2cb3a45729f
This aligns with the changes made in whatwg/fetch#831. Fortunately the remainder of the prose already assumed it got a MIME type record rather than bytes.
Also known as "extract a MIME type" down right.
Tests: web-platform-tests/wpt#10525.
Helps with #814.
Fixes #529. Closes whatwg/mimesniff#30.
Preview | Diff