Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363408 - GzipFilter should not attempt to compress HTTP status 204
Summary: GzipFilter should not attempt to compress HTTP status 204
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 19:40 EST by Adam Zell CLA
Modified: 2011-11-14 01:30 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.