Skip to content

Enforcing the Charset on Content-Type is breaking the request. #2129

@deepaktaker

Description

@deepaktaker

The forced addition of a charset parameter in updateCharset() introduces a regression for integrations where the server expects an exact Content-Type without additional parameters.

The intent of the change (ensuring a deterministic charset for text media types) is valid and RFC-aligned, but it breaks interoperability with systems that do strict string matching on the Content-Type header.

Since AHC is widely used for legacy and enterprise systems (e.g., SAP, telecom integrations, XML gateways), the client should not mutate the Content-Type if the user has explicitly set it.

Expected behavior:
If the user sets a Content-Type manually, AHC should not alter it.

Actual behavior:
AHC rewrites text/* content types by forcefully appending ; charset=UTF-8, even when the caller does not want it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions