Skip to content

quarkus.http.enable-compression=true adds content-encoding gzip even for http 204 No content #49879

@Hemantkumar-Chigadani

Description

@Hemantkumar-Chigadani

Describe the bug

When http compress is enabled, content-encoding : gzip is added as http header for http 204 No Content cases which is not standard wrt http protocol. In your case; Apigee was failing with http 502 at gateway side

Expected behavior

When http compress is enabled, For http 204 No Content cases, following headers should not be added to response

Content-Length
Content-Encoding
Transfer-Encoding

https://tools.ietf.org/html/rfc7231#section-6.3.5

Actual behavior

When http compress is enabled, For http 204 No Content cases, Content-Encoding : gzip header added to response

How to Reproduce?

RESTEasy reactive controller

quarkus.http.enable-compression=true

 @POST
    @Path("/compression")
    public void createSms() {
        Log.info("Compression is called");

    }

Output of uname -a or ver

No response

Output of java -version

openjdk version "21" 2023-09-19 OpenJDK Runtime Environment (build 21+35-2513) OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)

Quarkus version or git rev

3.20.2

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 8.14.2 ------------------------------------------------------------ Build time: 2025-06-05 13:32:01 UTC Revision: 30db2a3bdfffa9f8b40e798095675f9dab990a9a Kotlin: 2.0.21 Groovy: 3.0.24 Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024 Launcher JVM: 21 (Oracle Corporation 21+35-2513)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions