You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/06/09 22:42:22 UTC
DO NOT REPLY [Bug 51350] New: mod_deflate compresses zero length
content into an invalid 20 byte body
https://issues.apache.org/bugzilla/show_bug.cgi?id=51350
Bug #: 51350
Summary: mod_deflate compresses zero length content into an
invalid 20 byte body
Product: Apache httpd-2
Version: 2.2.16
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_deflate
AssignedTo: bugs@httpd.apache.org
ReportedBy: apache@tibit.com
Classification: Unclassified
When my web application returns a response with an empty body and Content-Type:
text/plain or text/html, mod_deflate replaces the body with 20 bytes that can't
be decompressed. I'm guessing this is a gzip header created when trying to
deflate 0 bytes of data.
Wireshark reports "Error: Decompression Failed" on those 20 bytes, and I
believe some browsers choke on them as well.
Unfortunately, since various web frameworks default to a text Content-Type for
empty responses, this means the bad body is pretty common on things like
OPTIONS responses.
I have verified that the Content-Type header field triggers the problem by
writing special-case code to intercept it on 0-byte responses. Removing that
header field or using an alternative type (e.g. 'application/json') makes the
invalid 20-byte body disappear.
I'm using a stock Ubuntu build of Apache.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 51350] mod_deflate compresses zero length content
into an invalid 20 byte body
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51350
Stefan Fritsch <sf...@sfritsch.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #3 from Stefan Fritsch <sf...@sfritsch.de> 2012-02-26 17:11:27 UTC ---
fixed in 2.4.1
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 51350] mod_deflate compresses zero length content
into an invalid 20 byte body
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51350
Stefan Fritsch <sf...@sfritsch.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |FixedInTrunk
--- Comment #1 from Stefan Fritsch <sf...@sfritsch.de> 2011-07-13 20:39:24 UTC ---
For me (on trunk and 2.2.19), httpd sends "Content-Length: 20" but no body at
all. Is that what you see or do you see those 20 bytes of body data?
In any case, fixed in trunk in r1146418.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 51350] mod_deflate compresses zero length content
into an invalid 20 byte body
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51350
--- Comment #2 from Stefan Fritsch <sf...@sfritsch.de> 2011-07-13 21:11:37 UTC ---
(In reply to comment #1)
> For me (on trunk and 2.2.19), httpd sends "Content-Length: 20" but no body at
> all. Is that what you see or do you see those 20 bytes of body data?
Never mind. I just didn't look correctly.
But skipping compression for zero length files is a valid optimization, anyway.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org