Skip to content

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

Open
Alexandre Kohler (kwy404) wants to merge 1 commit into
microsoft:mainfrom
kwy404:fix-json-content-type-case
Open

Alexandre Kohler (kwy404) wants to merge 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

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.

This branch has not been deployed

No deployments
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.

1 participant