https://bz.apache.org/bugzilla/show_bug.cgi?id=67685
Bug ID: 67685
Summary: Connector Compression adds unwanted "Content-Length"
header with size of uncompressed response
Product: Tomcat 10
Version: 10.1.14
Hardware: PC
OS: Linux
Status: NEW
Severity: regression
Priority: P2
Component: Connectors
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ------
I spotted what I think is a regression in Tomcat 10.1.14. Everything works fine
in 10.1.13.
Here is the context of my test, I've tried to dumb it down to something
trivial:
* Embedded Tomcat 10.1.14
* Activated the compression:
ctr.setProperty("compression", "on");
ctr.setProperty("compressionMinSize", "5");
ctr.setProperty("compressibleMimeType", "text/html");
* Wrote a simple servlet (async though):
response.setStatus(200);
response.setContentType("text/html);
response.setCharacterEncoding("UTF-8");
response.getOutputStream().write("sample string not too short but not too
big".getBytes(StandardCharsets.UTF_8));
In that scenario, the content is more than 5 bytes so the response is
compressed, *but* the "Content-Length" http header is added to the length of
the uncompressed response. Browsers don't like that at all and timeout after
1mn complaining that some data is missing. Tomcat is close to being useless.
Only fix I could find is to disable compression or go back to 10.1.13
Context:
* Java 17.0.8.1
* Tomcat 10.1.14
* org.apache.catalina.connector.Connector
* Tomcat used standalone (not behind httpd)
* Tomcat embedded with "org.apache.tomcat.embed" artifact in maven
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]