Closed Bug 1969483 Opened 11 months ago Closed 11 months ago

[wpt-sync] Sync PR 52872 - [net] Recognize *+json MIME types as JSON behind a flag

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
141 Branch
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}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

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

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

Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Blocks: 1970181
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: