[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#470652: apache2.2-common: mod_cache doesn't handle If-Range correctly



Subject: apache2.2-common: mod_cache doesn't handle If-Range correctly
Package: apache2.2-common
Version: 2.2.3-4+etch4
Severity: normal
Tags: patch

*** Please type your report below this line ***

Using mod_cache, if an object is in the cache, but expired,
and the backend has a newer version of the object, and a client
makes an If-Range request, then mod_cache will ignore the
If-Range condition and return only the requested Range of the
new version, even when it should have returned the whole of the
new version.

<https://issues.apache.org/bugzilla/show_bug.cgi?id=44579> has
a more detailed report and the following patch for Apache 2.2.8,
which will also work on 2.2.3:

Index: modules/cache/mod_cache.c
===================================================================
--- modules/cache/mod_cache.c   (revision 634179)
+++ modules/cache/mod_cache.c   (working copy)
@@ -613,6 +613,12 @@
             cache->provider->remove_entity(cache->stale_handle);
             /* Treat the request as if it wasn't conditional. */
             cache->stale_handle = NULL;
+            /*
+             * Restore the original request headers as they may be needed
+             * by further output filters like the byterange filter to make
+             * the correct decisions.
+             */
+            r->headers_in = cache->stale_headers;
         }
     }


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)



Reply to: