Skip to content

Response Compression Not Working Due to Missing Accept-Encoding Header #1204

@dekholud

Description

@dekholud

Describe the bug
I'm using the compression feature of the spring-cloud-openfeign library. However, I can see that the response compression is not working because the Accept-Encoding header is not being sent on the client side. Additionally, the FeignAcceptGzipEncodingInterceptor is missing from the requestInterceptors field in the SynchronousMethodHandler class.

Interestingly, when I create the following bean:

@Bean
Client defaultClient() {
    return new Client.Default(null, null);
}

The Accept-Encoding header starts being sent, and the FeignAcceptGzipEncodingInterceptor appears in the list of requestInterceptors.

Sample
To reproduce the bug, I have added a repository: https://github.com/dekholud/spring-cloud-openfeign-issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions