[wpt-sync] Sync PR 52872 - [net] Recognize *+json MIME types as JSON behind a flag
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox141 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Attachments
(2 files)
Sync web-platform-tests PR 52872 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/52872
Details from upstream follow.
Issack John <issackjohn@microsoft.com> wrote:
[net] Recognize *+json MIME types as JSON behind a flag
WHAT
- Updates net::MatchesMimeType() to properly validate MIME types when
wildcard patterns are used with validation enabled- Introduces Blink runtime flag SpecCompliantJsonMimeTypes which controls which pattern is used in IsJSONMimeType.
WHY
- Per WHATWG mimesniff §4.6, a JSON MIME type is one whose: essence is "application/json" or "text/json", OR any MIME type whose subtype ends in "+json"
- Previous implementation missed legitimate JSON types like
"text/html+json" or "image/svg+json".Bug: 399689607,362282752
Change-Id: I25489288b352b84d0a1f8d4cc01dd74d850cc3ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6525687
Reviewed-by: mmenke \<mmenke@chromium.org>
Commit-Queue: Issack John \<issackjohn@microsoft.com>
Reviewed-by: Dmitry Gozman \<dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1467525}
| Assignee | ||
Updated•11 months ago
|
| Assignee | ||
Comment 1•11 months ago
|
||
| Assignee | ||
Comment 2•11 months ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 4 tests and 8 subtests
Status Summary
Firefox
OK : 4
PASS: 41
FAIL: 3
Chrome
OK : 4
PASS: 41
FAIL: 3
Safari
OK : 4
PASS: 41
FAIL: 3
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/semantics/scripting-1/the-script-element/json-module/invalid-content-type.any.worker.html [wpt.fyi]
- Try importing JSON module with MIME type text/json/json+json:
FAIL(Chrome:PASS, Safari:FAIL)
- Try importing JSON module with MIME type text/json/json+json:
- /html/semantics/scripting-1/the-script-element/json-module/invalid-content-type.any.html [wpt.fyi]
- Try importing JSON module with MIME type text/json/json+json:
FAIL(Chrome:PASS, Safari:FAIL)
- Try importing JSON module with MIME type text/json/json+json:
- /html/semantics/scripting-1/the-script-element/json-module/invalid-content-type.any.sharedworker.html [wpt.fyi]
- Try importing JSON module with MIME type text/json/json+json:
FAIL(Chrome:PASS, Safari:FAIL)
- Try importing JSON module with MIME type text/json/json+json:
| Assignee | ||
Comment 3•11 months ago
|
||
Automatic update from web-platform-tests
[net] Recognize *+json MIME types as JSON behind a flag
WHAT
- Updates net::MatchesMimeType() to properly validate MIME types when
wildcard patterns are used with validation enabled - Introduces Blink runtime flag SpecCompliantJsonMimeTypes which controls which pattern is used in IsJSONMimeType.
WHY
- Per WHATWG mimesniff §4.6, a JSON MIME type is one whose: essence is "application/json" or "text/json", OR any MIME type whose subtype ends in "+json"
- Previous implementation missed legitimate JSON types like
"text/html+json" or "image/svg+json".
Bug: 399689607,362282752
Change-Id: I25489288b352b84d0a1f8d4cc01dd74d850cc3ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6525687
Reviewed-by: mmenke <mmenke@chromium.org>
Commit-Queue: Issack John <issackjohn@microsoft.com>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1467525}
--
wpt-commits: f75b1d74338bb35d58839c7e131a796962305d08
wpt-pr: 52872
| Assignee | ||
Comment 4•11 months ago
|
||
wpt-pr: 52872
wpt-type: metadata
Comment 6•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/afe0bc3fbd57
https://hg.mozilla.org/mozilla-central/rev/7f8b98af61f8
Description
•