]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
cachemgr.cgi: Drop cache_object protocol support (#1252)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 2 Feb 2023 22:42:48 +0000 (22:42 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 2 Feb 2023 22:42:52 +0000 (22:42 +0000)
tools/cachemgr.cc

index de2fa12c960ec318069c48012cc20ae18bf993c7..1a002386a0a0d64b3dc8301c3669f7991ded9aae 100644 (file)
@@ -861,16 +861,20 @@ process_request(cachemgr_request * req)
 
     Ip::Address::FreeAddr(AI);
 
+    // XXX: missing backward compatibility for old Squid.
+    // Squid-3.1 and older do not support http scheme manager requests.
+    // Squid-3.2 versions have bugs with https scheme manager requests.
     l = snprintf(buf, sizeof(buf),
-                 "GET cache_object://%s/%s%s%s HTTP/1.0\r\n"
+                 "GET /squid-internal-mgr/%s%s%s HTTP/1.0\r\n" // HTTP/1.0 because this tool does not support Transfer-Encoding
+                 "Host: %s\r\n"
                  "User-Agent: cachemgr.cgi/%s\r\n"
                  "Accept: */*\r\n"
                  "%s"           /* Authentication info or nothing */
                  "\r\n",
-                 req->hostname,
                  req->action,
                  req->workers? "?workers=" : (req->processes ? "?processes=" : ""),
                  req->workers? req->workers : (req->processes ? req->processes: ""),
+                 req->hostname,
                  VERSION,
                  make_auth_header(req));
     if (write(s, buf, l) < 0) {