]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Manager: send User-Agent header from cachemgr.cgi
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Apr 2011 12:06:47 +0000 (06:06 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Apr 2011 12:06:47 +0000 (06:06 -0600)
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 the 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 35cc6a35d2e5657121796a75212b7153d99bf04e..1af18d15c162e54f431886f4f423ad43f12b74f1 100644 (file)
@@ -864,11 +864,13 @@ process_request(cachemgr_request * req)
 
     l = snprintf(buf, sizeof(buf),
                  "GET cache_object://%s/%s HTTP/1.0\r\n"
+                 "User-Agent: cachemgr.cgi/%s\r\n"
                  "Accept: */*\r\n"
                  "%s"                  /* Authentication info or nothing */
                  "\r\n",
                  req->hostname,
                  req->action,
+                 VERSION,
                  make_auth_header(req));
     if (write(s, buf, l) < 0) {
         debug(1) fprintf(stderr, "ERROR: (%d) writing request: '%s'\n", errno, buf);