Add a boolean config option "DisableViaHeader".

This commit is contained in:
Michael Adam 2009-10-11 01:13:15 +02:00
parent f46aeca9a5
commit f208b1222b
2 changed files with 17 additions and 0 deletions

View File

@ -131,6 +131,7 @@ static HANDLE_FUNC (handle_timeout);
static HANDLE_FUNC (handle_user); static HANDLE_FUNC (handle_user);
static HANDLE_FUNC (handle_viaproxyname); static HANDLE_FUNC (handle_viaproxyname);
static HANDLE_FUNC (handle_disableviaheader);
static HANDLE_FUNC (handle_xtinyproxy); static HANDLE_FUNC (handle_xtinyproxy);
#ifdef UPSTREAM_SUPPORT #ifdef UPSTREAM_SUPPORT
@ -182,6 +183,7 @@ struct {
/* boolean arguments */ /* boolean arguments */
STDCONF ("syslog", BOOL, handle_syslog), STDCONF ("syslog", BOOL, handle_syslog),
STDCONF ("bindsame", BOOL, handle_bindsame), STDCONF ("bindsame", BOOL, handle_bindsame),
STDCONF ("disableviaheader", BOOL, handle_disableviaheader),
/* integer arguments */ /* integer arguments */
STDCONF ("port", INT, handle_port), STDCONF ("port", INT, handle_port),
STDCONF ("maxclients", INT, handle_maxclients), STDCONF ("maxclients", INT, handle_maxclients),
@ -435,6 +437,19 @@ static HANDLE_FUNC (handle_viaproxyname)
return 0; return 0;
} }
static HANDLE_FUNC (handle_disableviaheader)
{
int r = set_bool_arg (&conf->disable_viaheader, line, &match[2]);
if (r) {
return r;
}
log_message (LOG_INFO,
"Disabling transmission of the \"Via\" header.");
return 0;
}
static HANDLE_FUNC (handle_defaulterrorfile) static HANDLE_FUNC (handle_defaulterrorfile)
{ {
return set_string_arg (&conf->errorpage_undef, line, &match[2]); return set_string_arg (&conf->errorpage_undef, line, &match[2]);

View File

@ -83,6 +83,8 @@ struct config_s {
*/ */
char *via_proxy_name; char *via_proxy_name;
unsigned int disable_viaheader; /* boolean */
/* /*
* Error page support. Map error numbers to file paths. * Error page support. Map error numbers to file paths.
*/ */