]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Honor httpd_suppress_version_string in more contexts (#1121)
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 19 Aug 2022 18:57:50 +0000 (18:57 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 19 Aug 2022 18:57:55 +0000 (18:57 +0000)
* HTML "signature" part of generated HTTP responses to URN requests
* Server header in generated HTTP redirect responses
* boundary strings in generated HTTP 206 multipart/byteranges responses

Also document known contexts outside the configuration directive reach.
We may assert that all of them are outside the current "httpd" scope
(implied by the directive name), but admins may not know how we define
that "httpd" scope; being more explicit may reduce surprises.

src/HttpReply.cc
src/cf.data.pre
src/client_side.cc
src/urn.cc

index 329dab60651e07a4d5fa388794b263f79f981d10..195dfd136af3f7661c48d8ef72f8b17df7bf8c40 100644 (file)
@@ -204,7 +204,7 @@ HttpReply::redirect(Http::StatusCode status, const char *loc)
     HttpHeader *hdr;
     sline.set(Http::ProtocolVersion(), status, nullptr);
     hdr = &header;
-    hdr->putStr(Http::HdrType::SERVER, APP_FULLNAME);
+    hdr->putStr(Http::HdrType::SERVER, visible_appname_string);
     hdr->putTime(Http::HdrType::DATE, squid_curtime);
     hdr->putInt64(Http::HdrType::CONTENT_LENGTH, 0);
     hdr->putStr(Http::HdrType::LOCATION, loc);
index 320ba5d9f466530ff6e3140c6e931ef01539c91a..e0dd1742369e6b753053889387faa1a0feef5d66 100644 (file)
@@ -7470,7 +7470,10 @@ TYPE: onoff
 DEFAULT: off
 LOC: Config.onoff.httpd_suppress_version_string
 DOC_START
-       Suppress Squid version string info in HTTP headers and HTML error pages.
+       Do not send Squid version string in HTTP metadata and generated content
+       such as HTML error pages. Squid version string is still present in certain
+       SNMP responses, cachemgr.cgi output, squidclient User-Agent request header
+       field, various console output, and cache.log.
 DOC_END
 
 NAME: visible_hostname
index e262db288cef3c74305c6cbd369e0a208cddbced..7867898ede0b724e51583629592d3c0c37076627 100644 (file)
@@ -793,7 +793,7 @@ String
 ClientHttpRequest::rangeBoundaryStr() const
 {
     const char *key;
-    String b(APP_FULLNAME);
+    String b(visible_appname_string);
     b.append(":",1);
     key = storeEntry()->getMD5Text();
     b.append(key, strlen(key));
index 363b8be3b08c7403238c8ccd7265ca21dc89271f..5c7907c65ef3814af435923f01fedb29776144ef 100644 (file)
@@ -361,7 +361,7 @@ urnHandleReply(void *data, StoreIOBuffer result)
         "<ADDRESS>\n"
         "Generated by %s@%s\n"
         "</ADDRESS>\n",
-        APP_FULLNAME, getMyHostname());
+        visible_appname_string, getMyHostname());
     rep = new HttpReply;
     rep->setHeaders(Http::scFound, nullptr, "text/html", mb->length(), 0, squid_curtime);