Skip to content

http: preserve Content-Type parameters set in DSL (fixes #3843)#3860

Merged
raphael merged 2 commits intov3from
fix/3843-preserve-content-type-params
Dec 14, 2025
Merged

http: preserve Content-Type parameters set in DSL (fixes #3843)#3860
raphael merged 2 commits intov3from
fix/3843-preserve-content-type-params

Conversation

@raphael
Copy link
Member

@raphael raphael commented Dec 14, 2025

Fixes #3843.

When ContentType(...) is explicitly set in the DSL, ResponseEncoder parsed it to infer the encoder, but then overwrote the response header with the parsed media type, dropping parameters like charset.

This change keeps using the parsed media type for encoder selection, but sets the header using the original DSL value, preserving parameters.

Added a unit test asserting the charset parameter is preserved.

@raphael raphael disabled auto-merge December 14, 2025 23:20
@raphael raphael merged commit f5e57e2 into v3 Dec 14, 2025
6 checks passed
@raphael raphael deleted the fix/3843-preserve-content-type-params branch December 14, 2025 23:20
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.

ContentType does not return charset when using the default encoder

1 participant