Skip to content

fix(network): honor existing Content-Type for route.fulfill({ json }) - #44120

Closed
rome-xi wants to merge 1 commit into
microsoft:mainfrom
rome-xi:fix-44109-fulfill-json-content-type
Closed

rome-xi wants to merge 1 commit into
microsoft:mainfrom
rome-xi:fix-44109-fulfill-json-content-type

Conversation

@rome-xi

@rome-xi rome-xi commented Nov 14, 2026

Copy link
Copy Markdown

route.fulfill({ json }) was replacing a Content-Type the caller had already set, and it did not set application/json for null, false, 0, or '' even though those values were already sent as JSON. The content type is now application/json only when the caller did not set one, and that includes those values. An explicit contentType option still wins.

Fixes #44109

Set application/json for every json value, including null, false, 0 and
an empty string, and keep a content type the caller already provided.

Fixes microsoft#44109
@dcrousso

Copy link
Copy Markdown
Contributor

this is being handled in #44149

@rome-xi

rome-xi commented Nov 17, 2026

Copy link
Copy Markdown
Author

Thanks Devin Rousso (@dcrousso) — glad this is covered in #44149. I won't reopen.

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.

[Bug]: route.fulfill({ json }) replaces a Content-Type set in headers and sets none for null, false, 0 and ''

2 participants