Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2bc447c7562b89bf6a26a52fdc9a3c9f44efde8b
      
https://github.com/WebKit/WebKit/commit/2bc447c7562b89bf6a26a52fdc9a3c9f44efde8b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M LayoutTests/inspector/unit-tests/mimetype-utilities-expected.txt
    M LayoutTests/inspector/unit-tests/mimetype-utilities.html
    M Source/WebInspectorUI/UserInterface/Base/Utilities.js

  Log Message:
  -----------
  Web Inspector: parseMIMEType doesn't strip quotes from a quoted charset
https://bugs.webkit.org/show_bug.cgi?id=319279
rdar://182119496

Reviewed by Devin Rousso.

parseMIMEType passed a plain string to String.prototype.replace when
trying to trim the surrounding quotes from a charset value. A string
first argument is matched literally, not as a regular expression, so the
call searched for the literal sequence `^"|"$` — which never appears in
a real value — and the quotes were never removed. As a result a header
like `text/html; charset="utf-8"` yielded an encoding of `"utf-8"`
(quotes included), which then showed up quoted in the resource details
and headers views.

Use replaceAll to strip the quote characters from the charset value.

* Source/WebInspectorUI/UserInterface/Base/Utilities.js:
(parseMIMEType):

* LayoutTests/inspector/unit-tests/mimetype-utilities.html:
* LayoutTests/inspector/unit-tests/mimetype-utilities-expected.txt:
Add coverage for quoted charset (and a quoted boundary, which is left
untrimmed as before).

Canonical link: https://commits.webkit.org/317120@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to