Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363408

Summary: GzipFilter should not attempt to compress HTTP status 204
Product: [RT] Jetty Reporter: Adam Zell <zellster>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox
Version: unspecified   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:

Description Adam Zell CLA 2011-11-09 19:40:28 EST
Build Identifier: Jetty 7.5.4

HTTP status 204 should not contain a message body (similar to 304) and should be excluded from the GzipFilter logic:

121     public void setStatus(int sc, String sm)
122     {
123         super.setStatus(sc,sm);
124         if (sc<200||sc>=300)
125             noGzip();
126     }

Because the typical 204 response does not have a Content-Length header, the filter attempts to compress an empty response.  Due to GZIP header information, the response does not end empty.

Reproducible: Always

Steps to Reproduce:
1.Configure GzipFilter
2.Return 204 from your servlet without setting Content-Length
3.
Comment 1 Jan Bartel CLA 2011-11-14 01:30:37 EST
Fixed for 7.5.5, and 8.0.5.