httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51350] New: mod_deflate compresses zero length content into an invalid 20 byte body
Date Thu, 09 Jun 2011 20:42:22 GMT

             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
    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:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message