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

Serializing of MIME types without space before parameters might be problematic #84

Closed
annevk opened this issue Oct 8, 2018 · 3 comments

Comments

@annevk
Copy link
Member

annevk commented Oct 8, 2018

It's a little bit unclear yet, but in the context of XMLHttpRequest where implementations currently modify in-place rather than parse-then-serialize for the Content-Type header during requests, Firefox noticed some issues switching strategies:

  1. https://bugzilla.mozilla.org/show_bug.cgi?id=1496754
  2. https://bugzilla.mozilla.org/show_bug.cgi?id=1494443

This might end up affecting MIME type serialization slightly or end up being a change to XMLHttpRequest. I'm raising this here since I know other implementers are also looking at these algorithms and I'd like to keep everyone informed somehow.

cc @rwlbuis @MattMenke2

@annevk
Copy link
Member Author

annevk commented Oct 16, 2018

So I think I'd prefer fixing this in XMLHttpRequest and here. Make XMLHttpRequest override less Content-Type headers and serialize MIME types with the space after ;. I hope that this change isn't too problematic to adopt.

I'll prepare PRs.

cc @hsivonen @wisniewskit @domenic

annevk added a commit to whatwg/xhr that referenced this issue Oct 16, 2018
This will help web compatibility and address all cases linked from whatwg/mimesniff#84.

Tests: ...
annevk added a commit that referenced this issue Oct 16, 2018
This is a defense-in-depth for the issues that arised at #84. In theory they are all solved by whatwg/xhr#224, but given how quickly several sites turned up that relied on a space, it seems prudent to standardize on that serialization to avoid similar issues elsewhere.
@annevk
Copy link
Member Author

annevk commented Oct 16, 2018

Per https://bugzilla.mozilla.org/show_bug.cgi?id=1454325#c15 this also breaks an outlook.com service, which would also be fixed by not meddling with things if the charset is already UTF-8.

annevk added a commit to web-platform-tests/wpt that referenced this issue Oct 30, 2018
annevk added a commit to whatwg/xhr that referenced this issue Oct 30, 2018
This will help web compatibility and address all cases linked from whatwg/mimesniff#84.

Tests: web-platform-tests/wpt#13779.
annevk added a commit to web-platform-tests/wpt that referenced this issue Oct 30, 2018
@annevk
Copy link
Member Author

annevk commented Oct 30, 2018

Closing this as whatwg/xhr#224 got merged. No changes to MIME Sniffing needed after all.

@annevk annevk closed this as completed Oct 30, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 10, 2018
…less, a=testonly

Automatic update from web-platform-testsXMLHttpRequest: manipulate Content-Type less

For whatwg/xhr#224 and in particular whatwg/mimesniff#84.

This supersedes and closes #13544.

--

wpt-commits: 99f4fdcd906411c036e96c055e28b3e6ca84a1cc
wpt-pr: 13779
jyc pushed a commit to jyc/gecko that referenced this issue Nov 11, 2018
…less, a=testonly

Automatic update from web-platform-testsXMLHttpRequest: manipulate Content-Type less

For whatwg/xhr#224 and in particular whatwg/mimesniff#84.

This supersedes and closes #13544.

--

wpt-commits: 99f4fdcd906411c036e96c055e28b3e6ca84a1cc
wpt-pr: 13779
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…less, a=testonly

Automatic update from web-platform-testsXMLHttpRequest: manipulate Content-Type less

For whatwg/xhr#224 and in particular whatwg/mimesniff#84.

This supersedes and closes #13544.

--

wpt-commits: 99f4fdcd906411c036e96c055e28b3e6ca84a1cc
wpt-pr: 13779

UltraBlame original commit: f5b3c921363e751e6ad363970bd7727701d59525
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…less, a=testonly

Automatic update from web-platform-testsXMLHttpRequest: manipulate Content-Type less

For whatwg/xhr#224 and in particular whatwg/mimesniff#84.

This supersedes and closes #13544.

--

wpt-commits: 99f4fdcd906411c036e96c055e28b3e6ca84a1cc
wpt-pr: 13779

UltraBlame original commit: f5b3c921363e751e6ad363970bd7727701d59525
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…less, a=testonly

Automatic update from web-platform-testsXMLHttpRequest: manipulate Content-Type less

For whatwg/xhr#224 and in particular whatwg/mimesniff#84.

This supersedes and closes #13544.

--

wpt-commits: 99f4fdcd906411c036e96c055e28b3e6ca84a1cc
wpt-pr: 13779

UltraBlame original commit: f5b3c921363e751e6ad363970bd7727701d59525
This was referenced Oct 15, 2019
Bishwarupjee pushed a commit to Bishwarupjee/xhr that referenced this issue Jan 31, 2024
This will help web compatibility and address all cases linked from whatwg/mimesniff#84.

Tests: web-platform-tests/wpt#13779.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant