From: Graham Leggett Date: Fri, 4 Jun 2010 00:17:16 +0000 (+0000) Subject: mod_disk_cache: Decline the opportunity to cache if the response is X-Git-Tag: 2.3.6~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd646c8e2b585ac198d03f327413510ea43fc195;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951222 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index b7a4f71c6e..4e58c804d6 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,11 @@ Changes with Apache 2.3.6 processing is completed, avoiding orphaned callback pointers. [Brett Gervasoni , 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 ] diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c index b65c8bca4c..d0dd823c90 100644 --- a/modules/cache/mod_disk_cache.c +++ b/modules/cache/mod_disk_cache.c @@ -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,