Skip to content

HC5 client can't send compressed POST requests #2245

@fbus

Description

@fbus

ApacheHttp5Client does not check if there is an 'Accept-Encoding' header when building the HttpRequest

https://github.com/OpenFeign/feign/blob/885f3e3400e564c8a4aa2642629452e9604c552e/hc5/src/main/java/feign/hc5/ApacheHttp5Client.java#L124C12-L124C12

when there is a gzip header, it should create a GzipCompressingEntity to wrap the StringEntity / ByteArrayEntity.

Because of this, the body is not compressed, while my request has an 'Accept-Encoding: gzip' header. And the server replies with a '500 Not in GZIP format' error.

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