Skip to content

Spring WebFlux with Netty Doesn't Gzip Static Resources Correctly #12892

@brandongodwin

Description

@brandongodwin

Spring Boot Version

Tested with 2.0.1.RELEASE and the latest commit on master c43eb89.

Issue

When using Spring WebFlux with Netty and Gzip compression is enabled, the HTTP response correctly contains the content-encoding: gzip header, but the actual response body isn't compressed. This will cause Chrome to fail with ERR_CONTENT_DECODING_FAILED. Switching to a different sever, such as Undertow or Tomcat, will yield the correct result. Response bodies returned from a router function that are large enough to trigger compression seem to work fine, it only appears to happen for static resources.

Reproduction Steps

Using the spring-boot-sample-webflux project, create a public directory in src/main/resources/ and place this text file in there. Run the project with mvn spring-boot:run -Dserver.compression.enabled=true and navigate to http://localhost:8080/test.txt.

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions