]> granicus.if.org Git - apache/commitdiff
mod_disk_cache: Decline the opportunity to cache if the response is
authorGraham Leggett <minfrin@apache.org>
Fri, 4 Jun 2010 00:17:16 +0000 (00:17 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 4 Jun 2010 00:17:16 +0000 (00:17 +0000)
a 206 Partial Content. This stops a reverse proxied partial response
from becoming cached, and then being served in subsequent responses.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951222 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index b7a4f71c6e0a0d99dcb2b98db868514fa4fc48cf..4e58c804d62dd9b550b01d97f4fcdd2ba29a8031 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,11 @@ Changes with Apache 2.3.6
      processing is completed, avoiding orphaned callback pointers.
      [Brett Gervasoni <brettg senseofsecurity.com>, Jeff Trawick]
 
+  *) mod_disk_cache: Decline the opportunity to cache if the response is
+     a 206 Partial Content. This stops a reverse proxied partial response
+     from becoming cached, and then being served in subsequent responses.
+     [Graham Leggett]
+
   *) mod_deflate: avoid the risk of forwarding data before headers are set.
      PR 49369 [Matthew Steele <mdsteele google.com>]
 
index b65c8bca4c69d4dc826e7d955b8d3bf4c019024c..d0dd823c9065d6fdf84cab338dae707ff61235dc 100644 (file)
@@ -333,6 +333,14 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr
         return DECLINED;
     }
 
+    /* we don't support caching of range requests (yet) */
+    if (r->status == HTTP_PARTIAL_CONTENT) {
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                     "disk_cache: URL %s partial content response not cached",
+                     key);
+        return DECLINED;
+    }
+
     /* Note, len is -1 if unknown so don't trust it too hard */
     if (len > conf->maxfs) {
         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,