demo · v142
Charset, Parameters, and Edge Cases
The MIME-validation regression test sheet the spec-PR thread argued about for weeks. Pre-Chrome-142 Blink sniffed leniently — application/json;ASDF was accepted. Strict RFC 8259 token rules now apply to JSON-module MIMEs: parameter names must be HTTP tokens, quoted-strings are honoured, whitespace is allowed only in specific positions, and charsets other than UTF-8 are rejected. Below: a regression sheet with what the old / new validators decide, plus a probe that imports a module returning each MIME for real.
"Pre-142" follows the old sniffing heuristic. "Strict (142+)" follows the new RFC 8259-aligned tokeniser. The third badge is what Chrome decides on this run — the row uses dynamic import() against a data URL to actually try the MIME live.
relevant grammar
// What Chrome 142+ accepts as a JSON module MIME
mime-type = "application/json"
/ "application/" *token "+json"
/ "text/json" // legacy
parameter = token "=" ( token / quoted-string )
token = 1*<any CHAR except CTLs or separators>