From e4e635e13a0e8e7fc71cd9b47782861efab87e73 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 12 Apr 2011 23:33:32 +1200 Subject: [PATCH] Manager: send User-Agent header from cachemgr.cgi 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 4f52a157a6..392fe5d832 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -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); -- 2.47.2