the HTTP server headers and in the HTML error pages.
New squid.conf directive:
httpd_suppress_version_string on | off (default on)
Based on contribution from Nathan R. Valentine (thanks !!!)
/*
- * $Id: HttpReply.cc,v 1.70 2004/12/21 17:52:53 robertc Exp $
+ * $Id: HttpReply.cc,v 1.71 2005/05/01 08:11:47 serassio Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
assert(reply);
httpStatusLineSet(&reply->sline, ver, status, reason);
hdr = &reply->header;
- httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
+ httpHeaderPutStr(hdr, HDR_SERVER, visible_appname_string);
httpHeaderPutStr(hdr, HDR_MIME_VERSION, "1.0");
httpHeaderPutTime(hdr, HDR_DATE, squid_curtime);
/*
- * $Id: cache_cf.cc,v 1.471 2005/04/25 15:46:35 serassio Exp $
+ * $Id: cache_cf.cc,v 1.472 2005/05/01 08:11:47 serassio Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
Config.onoff.announce = 0;
}
+ if (Config.onoff.httpd_suppress_version_string)
+ visible_appname_string = (char *)appname_string;
+ else
+ visible_appname_string = (char *)full_appname_string;
+
#if USE_DNSSERVERS
+
if (Config.dnsChildren < 1)
fatal("No dnsservers allocated");
snprintf(ThisCache, sizeof(ThisCache), "%s (%s)",
uniqueHostname(),
- full_appname_string);
+ visible_appname_string);
/*
* the extra space is for loop detection in client_side.c -- we search
*/
snprintf(ThisCache2, sizeof(ThisCache), " %s (%s)",
uniqueHostname(),
- full_appname_string);
+ visible_appname_string);
if (!Config.udpMaxHitObjsz || Config.udpMaxHitObjsz > SQUID_UDP_SO_SNDBUF)
Config.udpMaxHitObjsz = SQUID_UDP_SO_SNDBUF;
#
-# $Id: cf.data.pre,v 1.386 2005/04/24 14:00:45 serassio Exp $
+# $Id: cf.data.pre,v 1.387 2005/05/01 08:11:48 serassio Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
DOC_END
+NAME: httpd_suppress_version_string
+COMMENT: on|off
+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.
+DOC_END
+
+
NAME: visible_hostname
TYPE: string
LOC: Config.visibleHostname
/*
- * $Id: errorpage.cc,v 1.200 2005/04/23 13:20:30 serassio Exp $
+ * $Id: errorpage.cc,v 1.201 2005/05/01 08:11:48 serassio Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
break;
case 's':
- p = full_appname_string;
+ p = visible_appname_string;
break;
case 'S':
/*
- * $Id: ftp.cc,v 1.361 2005/03/05 14:51:52 serassio Exp $
+ * $Id: ftp.cc,v 1.362 2005/05/01 08:11:48 serassio Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
storeAppendPrintf(e, "Generated %s by %s (%s)\n",
mkrfc1123(squid_curtime),
getMyHostname(),
- full_appname_string);
+ visible_appname_string);
storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
storeBufferFlush(e);
}
/*
- * $Id: globals.h,v 1.131 2005/04/23 12:28:11 serassio Exp $
+ * $Id: globals.h,v 1.132 2005/05/01 08:11:48 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern const char *const null_string; /* "" */
extern const char *const version_string; /* VERSION */
extern const char *const full_appname_string; /* PACKAGE "/" VERSION */
+extern const char *const appname_string; /* PACKAGE */
+extern char * visible_appname_string;
extern const char *const w_space; /* " \t\n\r" */
extern const char *fdTypeStr[];
extern const char *hier_strings[];
/*
- * $Id: gopher.cc,v 1.186 2005/01/28 09:23:41 serassio Exp $
+ * $Id: gopher.cc,v 1.187 2005/05/01 08:11:48 serassio Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
storeAppendPrintf(e, "Generated %s by %s (%s)\n",
mkrfc1123(squid_curtime),
getMyHostname(),
- full_appname_string);
+ visible_appname_string);
storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
}
/*
- * $Id: structs.h,v 1.517 2005/04/23 14:49:41 serassio Exp $
+ * $Id: structs.h,v 1.518 2005/05/01 08:11:48 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
Log;
char *adminEmail;
char *effectiveUser;
+ char *visible_appname_string;
char *effectiveGroup;
struct
int check_hostnames;
int via;
int emailErrData;
+ int httpd_suppress_version_string;
}
onoff;