Skip to content

fix(fetch): match Content-Type header case-insensitively - #3210

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
kwy404:fix-json-content-type-case
Oct 6, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
kwy404:fix-json-content-type-case

Conversation

@kwy404

@kwy404 Alexandre Kohler (kwy404) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

is_json_content_type only matched the exact header name Content-Type, so a request sent with content-type: application/json had its string data passed through unchanged instead of being treated as JSON. Header names are case-insensitive and Playwright for JS already compares them that way, so the check now lowercases the name.

The lowercase header case is covered by the new test_should_json_stringify_string_body_when_content_type_is_application_json in tests/async/test_fetch_global.py.

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 5005dc0 into microsoft:main Oct 6, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants