]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2258 pt2: bypassing cache but not destroying cache entry
authorGarri Djavadyan <garryd@comnet.uz>
Sun, 11 Dec 2016 06:15:03 +0000 (19:15 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 11 Dec 2016 06:15:03 +0000 (19:15 +1300)
src/HttpRequest.cc

index efcdde59a54b23a2d32911782bfc9561c6f09dd5..732a1ad95f3cb0f2d63a7bb37ce514b8a61dcafb 100644 (file)
@@ -543,8 +543,13 @@ HttpRequest::maybeCacheable()
         if (!method.respMaybeCacheable())
             return false;
 
-        // XXX: this would seem the correct place to detect request cache-controls
-        //      no-store, private and related which block cacheability
+        // RFC 7234 section 5.2.1.5:
+        // "cache MUST NOT store any part of either this request or any response to it"
+        //
+        // NP: refresh_pattern ignore-no-store only applies to response messages
+        //     this test is handling request message CC header.
+        if (!flags.ignoreCc && cache_control && cache_control->noStore())
+            return false;
         break;
 
     case AnyP::PROTO_GOPHER: