]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Jun 2009 10:03:04 +0000 (22:03 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Jun 2009 10:03:04 +0000 (22:03 +1200)
Bug 2481: Don't set expires: now in generated error responses

Sending Expires: "now" overrides any negative cache logics which may
be present in downstream caches and is a bad idea. Better to send
the responses without any explicit expiry information.

src/errorpage.cc

index 315fa082754f2ed53a290a72b925cd0cee19b85d..ca49860d7d08294edfa87b1e40735dc1a9a79e56 100644 (file)
@@ -860,7 +860,7 @@ errorBuildReply(ErrorState * err)
 
     if (strchr(name, ':')) {
         /* Redirection */
-        rep->setHeaders(version, HTTP_MOVED_TEMPORARILY, NULL, "text/html", 0, 0, squid_curtime);
+        rep->setHeaders(version, HTTP_MOVED_TEMPORARILY, NULL, "text/html", 0, 0, -1);
 
         if (err->request) {
             char *quoted_url = rfc1738_escape_part(urlCanonical(err->request));
@@ -870,7 +870,7 @@ errorBuildReply(ErrorState * err)
         httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s", err->httpStatus, "Access Denied");
     } else {
         MemBuf *content = errorBuildContent(err);
-        rep->setHeaders(version, err->httpStatus, NULL, "text/html", content->contentSize(), 0, squid_curtime);
+        rep->setHeaders(version, err->httpStatus, NULL, "text/html", content->contentSize(), 0, -1);
         /*
          * include some information for downstream caches. Implicit
          * replaceable content. This isn't quite sufficient. xerrno is not