Skip to content

Conversation

@SriLakshmiPolavarapu
Copy link

@SriLakshmiPolavarapu SriLakshmiPolavarapu commented Jan 1, 2026

Ready for review Powered by Pull Request Badge

This PR fixes an issue where FetchResponse overwrote user-defined Content-Type headers.

Before, mapResponseBody() always replaced Content-Type based on body type.
After, ensures Content-Type is only set when not already provided.

Fixes #1817

Copy link
Member

@sgammon sgammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the fix; please fix formatting and don't forget to rebase, as the null ConsoleIntrinsic bug had a fix merged

Comment on lines 156 to 158
if (!headers.has("Content-Type")) {
headers.set("Content-Type", "text/plain")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz fix formatting here

Comment on lines 182 to 184
if (!headers.has("Content-Type")) {
headers.set("Content-Type", "application/json")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Comment on lines 197 to 200
val serializedArgs = when {
args == null -> listOf("null")
else -> args.toList().filterNotNull()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

args == null
and
else ->
should both be indented here

Copy link
Member

@sgammon sgammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, once the changes above are posted, I can approve

@SriLakshmiPolavarapu SriLakshmiPolavarapu force-pushed the fix-content-type-overwrite branch from ffd0b1f to c77e982 Compare January 4, 2026 22:21
@SriLakshmiPolavarapu
Copy link
Author

Hi, I’ve fixed the formatting and rebased onto the latest main as requested.
Let me know if anything else is needed!

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: Response Content-Type header is overwritten by mapResponseBody()

2 participants