httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject svn commit: r740149 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_deflate.c
Date Mon, 02 Feb 2009 23:20:37 GMT
Author: lars
Date: Mon Feb  2 23:20:37 2009
New Revision: 740149

URL: http://svn.apache.org/viewvc?rev=740149&view=rev
Log:
mod_deflate: Fix creation of invalid Etag headers. We now make sure
that the Etag value is properly quoted when adding the gzip marker.
PR 39727.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/filters/mod_deflate.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=740149&r1=740148&r2=740149&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Feb  2 23:20:37 2009
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.2
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_deflate: Fix creation of invalid Etag headers. We now make sure
+     that the Etag value is properly quoted when adding the gzip marker.
+     PR 39727. [Lars Eilebrecht]
+
   *) Added 20x22 icons for ODF, SVG, and XML documents.  PR 37185.
      [Peter Harlow]
 

Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?rev=740149&r1=740148&r2=740149&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c Mon Feb  2 23:20:37 2009
@@ -393,10 +393,13 @@
 static void deflate_check_etag(request_rec *r, const char *transform)
 {
     const char *etag = apr_table_get(r->headers_out, "ETag");
-    if (etag && (((etag[0] != 'W') && (etag[0] !='w')) || (etag[1] != '/')))
{
-        apr_table_set(r->headers_out, "ETag",
-                      apr_pstrcat(r->pool, etag, "-", transform, NULL));
-    }
+    if ((etag && (strlen(etag) > 2))) {
+        if (etag[0] == '"') {
+            etag = apr_pstrndup(r->pool, etag, strlen(etag) - 2);
+            apr_table_set(r->headers_out, "ETag",
+                          apr_pstrcat(r->pool, etag, "-", transform, "\"", NULL));
+        }
+    }   
 }
 static apr_status_t deflate_out_filter(ap_filter_t *f,
                                        apr_bucket_brigade *bb)



Mime
View raw message