Skip to content
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

Use HTTP rather than ASCII whitespace #90

Merged
merged 1 commit into from Nov 13, 2018
Merged

Use HTTP rather than ASCII whitespace #90

merged 1 commit into from Nov 13, 2018

Conversation

@annevk
Copy link
Member

@annevk annevk commented Oct 30, 2018

Tests: web-platform-tests/wpt#13615.

Fixes #89.


Preview | Diff

@annevk
Copy link
Member Author

@annevk annevk commented Oct 30, 2018

(The reason Travis fails is because HTTP whitespace isn't yet defined by Fetch.)

@annevk annevk requested a review from domenic Oct 31, 2018
@annevk
Copy link
Member Author

@annevk annevk commented Oct 31, 2018

Hmm, so I guess I should look into contexts where MIME types can have newlines and how those are handled today (or not handled at all).

@annevk
Copy link
Member Author

@annevk annevk commented Nov 2, 2018

Per #42 (comment) canPlayType() et al, overrideMimeType(), and Blob look like the places where newlines could show up.

Because of that I think we should use HTTP whitespace here and not HTTP tab or space. Implementations that don't share their MIME type parser across the code base could have slightly more restrictive code in contexts where newlines by definitions cannot show up.

@MattMenke2 @asankah I take it that's agreeable? (I'll add some tests for the aforementioned contexts as well if they don't have any for newlines.)

Note to self: need to add HTTP whitespace (a code point based version) to Fetch.

@MattMenke2
Copy link

@MattMenke2 MattMenke2 commented Nov 2, 2018

Is this just CRs and LFs? If so, I'm fine with that.

@annevk
Copy link
Member Author

@annevk annevk commented Nov 2, 2018

Yes.

@annevk
Copy link
Member Author

@annevk annevk commented Nov 5, 2018

I updated the tests to also test HTTP newlines (as per above) and created whatwg/fetch#828 to define HTTP whitespace in Fetch for this kind of usage (and added a note that hopefully dissuades others from using it unless they have an eerily similar data structure).

domenic
domenic approved these changes Nov 9, 2018
Copy link
Member

@domenic domenic left a comment

LGTM once HTTP whitespace is defined

annevk added a commit to web-platform-tests/wpt that referenced this issue Nov 12, 2018
annevk added a commit to whatwg/fetch that referenced this issue Nov 12, 2018
@annevk annevk merged commit 126286a into master Nov 13, 2018
2 checks passed
2 checks passed
@whatbot
Participation annevk participates on behalf of Mozilla Corporation
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@annevk annevk deleted the annevk/http-whitespace branch Nov 13, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 14, 2018
Automatic update from web-platform-testsMIME types: test 0x0B, 0x0C, and newlines

For whatwg/mimesniff#90.
--

wpt-commits: 6aeb68e38a61c2e332a7592f5cad640cf58b73f2
wpt-pr: 13615
staktrace pushed a commit to staktrace/gecko that referenced this issue Nov 15, 2018
Automatic update from web-platform-testsMIME types: test 0x0B, 0x0C, and newlines

For whatwg/mimesniff#90.
--

wpt-commits: 6aeb68e38a61c2e332a7592f5cad640cf58b73f2
wpt-pr: 13615
domenic added a commit to jsdom/whatwg-mimetype that referenced this issue Nov 20, 2018
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
Automatic update from web-platform-testsMIME types: test 0x0B, 0x0C, and newlines

For whatwg/mimesniff#90.
--

wpt-commits: 6aeb68e38a61c2e332a7592f5cad640cf58b73f2
wpt-pr: 13615

UltraBlame original commit: 726abced3085ed5e9ef5b0df43e9561cac6f590d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
Automatic update from web-platform-testsMIME types: test 0x0B, 0x0C, and newlines

For whatwg/mimesniff#90.
--

wpt-commits: 6aeb68e38a61c2e332a7592f5cad640cf58b73f2
wpt-pr: 13615

UltraBlame original commit: 726abced3085ed5e9ef5b0df43e9561cac6f590d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
Automatic update from web-platform-testsMIME types: test 0x0B, 0x0C, and newlines

For whatwg/mimesniff#90.
--

wpt-commits: 6aeb68e38a61c2e332a7592f5cad640cf58b73f2
wpt-pr: 13615

UltraBlame original commit: 726abced3085ed5e9ef5b0df43e9561cac6f590d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants