MIME type parser should not support single quotes |
||||||
Issue description
In particular:
> if (first_char == '"' || first_char == '\'') {
in http_util.cc is incorrect. Only double quoted values are supposed to be supported per the RFC. Chrome is alone in supporting single quotes.
,
Oct 6 2017
I'm certainly fine with removing it, after verifying that other browsers don't support single quotes. Looks like that block of code hasn't been modified since initial.commit, and I don't think it's worth digging before that to try and divine the exact motivation.
,
Oct 6 2017
Great, FWIW, I plan to work on web-platform-tests once the revised MIME type parser specification is more in order. For now I've scattered my various demo tests in issues on the aforementioned repository. If you end up writing tests as part of fixing this let me know and I can make sure to include them. (My goal is to get all browsers aligned on parsing MIME types, mostly so I can then get them aligned on processing data: URLs, but also because MIME types are pretty fundamental and deserve to be interoperable by now.)
,
Oct 6 2017
Anne: I'm happy to take this. You mentioned that Chrome is the only browser accepting single qoutes. What browsers can you confirm that they reject single quotes?
,
Oct 6 2017
Edge, Firefox, and Safari. If you put the code mentioned in the linked issue in a resource under web-platform-tests named [something].asis and run it using the web-platform-tests server you should be able to reproduce easily. They will all log windows-1252 rather than GBK.
,
Oct 6 2017
Thank you for your response. I believe comment #5 satisfies the "after verifying that other browsers don't support single quotes" clause of comment #2. (I do not have a web-platform-tests server set up on my computer, nor do I have access to Edge or Safari, thanks for checking for me.)
,
Oct 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8c1e3076613621477eb18fca29e623be4b73c1a3 commit 8c1e3076613621477eb18fca29e623be4b73c1a3 Author: Bence Béky <bnc@chromium.org> Date: Mon Oct 09 17:57:21 2017 Do not allow single quotes around Content-Type charset. Do not allow single quotes around Content-Type charset parameter, in compliance with RFC 7231 Section 3.1.1.1 ("quoted-string" is defined in RFC 7230 Section 3.2.6). Bug: 772350 Change-Id: Id8cf1676c49d086fce298285546561927ace057b Reviewed-on: https://chromium-review.googlesource.com/705757 Commit-Queue: Bence Béky <bnc@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#507407} [modify] https://crrev.com/8c1e3076613621477eb18fca29e623be4b73c1a3/net/http/http_response_headers_unittest.cc [modify] https://crrev.com/8c1e3076613621477eb18fca29e623be4b73c1a3/net/http/http_util.cc [modify] https://crrev.com/8c1e3076613621477eb18fca29e623be4b73c1a3/net/http/http_util_unittest.cc
,
Oct 9 2017
,
Jul 6
,
Jul 6
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by annevank...@gmail.com
, Oct 6 2017