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 2013/02/11 20:51:16 UTC

[Bug 54549] New: mod_mime AddEncoding and mod_negotiation fix_encoding() fixup hook

https://issues.apache.org/bugzilla/show_bug.cgi?id=54549

            Bug ID: 54549
           Summary: mod_mime AddEncoding and mod_negotiation
                    fix_encoding() fixup hook
           Product: Apache httpd-2
           Version: 2.4.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_mime
          Assignee: bugs@httpd.apache.org
          Reporter: daniel.lescohier@cnet.com
    Classification: Unclassified

In mod_mime's AddEncoding documentation:
https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addencoding

It says:

"Old clients expect x-gzip and x-compress, however the standard dictates that
they're equivalent to gzip and compress respectively. Apache does content
encoding comparisons by ignoring any leading x-. When responding with an
encoding Apache will use whatever form (i.e., x-foo or foo) the client
requested. If the client didn't specifically request a particular form Apache
will use the form given by the AddEncoding directive. To make this long story
short, you should always use x-gzip and x-compress for these two specific
encodings. More recent encodings, such as deflate, should be specified without
the x-."

This functionality of choosing x-gzip or gzip for Content-Encoding based on
Accept-Encoding actually depends on mod_negotiation being loaded, so that
mod_negotiation's fix_encoding() fixup hook is registered.

At minimum, the AddEncoding documentation should be updated to say that
mod_negotiation must be loaded in order for that functionality to work.

However, one could argue that the fix_encoding() fixup belongs in mod_mime
instead of mod_negotiation, because it implements a feature in mod_mime, not
mod_negotiation.

On my QA server, before loading mod_negotiation (see difference in last line of
each):

> GET /js/dw.js HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: dw.qa.com.com
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 200 OK
< Date: Mon, 11 Feb 2013 18:41:21 GMT
< Server: Apache/2.4.3
< Vary: Accept-Encoding
< Last-Modified: Wed, 05 Dec 2012 18:28:07 GMT
< ETag: "1a27-4d01f24cfbbc0"
< Accept-Ranges: bytes
< Content-Length: 6695
< Cache-Control: max-age=1800
< Expires: Mon, 11 Feb 2013 19:11:21 GMT
< P3P: CP="CAO DSP COR CURa ADMa DEVa PSAa PSDa IVAi IVDi CONi OUR OTRi IND PHY
ONL UNI FIN COM NAV INT DEM STA"
< Content-Type: application/javascript
< Content-Encoding: x-gzip

After loading mod_negotiation:

> GET /js/dw.js HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: dw.qa.com.com
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 200 OK
< Date: Mon, 11 Feb 2013 19:34:04 GMT
< Server: Apache/2.4.3
< Vary: Accept-Encoding
< Last-Modified: Wed, 05 Dec 2012 18:28:07 GMT
< ETag: "1a27-4d01f24cfbbc0"
< Accept-Ranges: bytes
< Content-Length: 6695
< Cache-Control: max-age=1800
< Expires: Mon, 11 Feb 2013 20:04:04 GMT
< P3P: CP="CAO DSP COR CURa ADMa DEVa PSAa PSDa IVAi IVDi CONi OUR OTRi IND PHY
ONL UNI FIN COM NAV INT DEM STA"
< Content-Type: application/javascript
< Content-Encoding: gzip

-- 
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