]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Manager: send User-Agent header from cachemgr.cgi
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 12 Apr 2011 11:33:32 +0000 (23:33 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 12 Apr 2011 11:33:32 +0000 (23:33 +1200)
Uses hard-coded string "cachemgr.cgi/" instead of progname to avoid
complications from alternative names and when running under a browser.

May be elided in transit however teh VERSION sent here will help the
queried proxy respond appropriate to the CGI capabilities as we extend
the types and content of reports coming back from the future releases.

tools/cachemgr.cc

index 4f52a157a6edf34bea33446f0fa5046ae6f13a67..392fe5d832933056bdece657bed9926c081029b4 100644 (file)
@@ -842,6 +842,7 @@ process_request(cachemgr_request * req)
 
     l = snprintf(buf, sizeof(buf),
                  "GET cache_object://%s/%s%s%s HTTP/1.0\r\n"
+                 "User-Agent: cachemgr.cgi/%s\r\n"
                  "Accept: */*\r\n"
                  "%s"                  /* Authentication info or nothing */
                  "\r\n",
@@ -849,6 +850,7 @@ process_request(cachemgr_request * req)
                  req->action,
                  req->workers? "?workers=" : (req->processes ? "?processes=" : ""),
                  req->workers? req->workers : (req->processes ? req->processes: ""),
+                 VERSION,
                  make_auth_header(req));
     if (write(s, buf, l) < 0) {
         fprintf(stderr,"ERROR: (%d) writing request: '%s'\n", errno, buf);