From d9b03d4dffb1b27c2c8281889630ebc8264a6add Mon Sep 17 00:00:00 2001 From: Eduard Bagdasaryan Date: Thu, 2 Feb 2023 22:42:48 +0000 Subject: [PATCH] cachemgr.cgi: Drop cache_object protocol support (#1252) --- tools/cachemgr.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index de2fa12c96..1a002386a0 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -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) { -- 2.39.2