ASF Bugzilla – Attachment 18629 Details for
Bug 40026
Impossibility to unset Server Header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Make sending the Server header configurable via httpd.conf
servertokens_off.patch (text/plain), 2.14 KB, created by
Sebastian Nohn
on 2006-07-23 16:06:56 UTC
(
hide
)
Description:
Make sending the Server header configurable via httpd.conf
Filename:
MIME Type:
Creator:
Sebastian Nohn
Created:
2006-07-23 16:06:56 UTC
Size:
2.14 KB
patch
obsolete
>diff -ru httpd-2.0.58/modules/http/http_protocol.c httpd-2.0.58.new/modules/http/http_protocol.c >--- httpd-2.0.58/modules/http/http_protocol.c 2006-04-24 19:12:21.000000000 +0200 >+++ httpd-2.0.58.new/modules/http/http_protocol.c 2006-07-23 17:53:01.000000000 +0200 >@@ -1280,12 +1280,15 @@ > } > } > else { >- form_header_field(&h, "Server", ap_get_server_version()); >+ char *server_version = ap_get_server_version(); >+ if (server_version[0] != '\0') { >+ form_header_field(&h, "Server", ap_get_server_version()); >+ } > } > > /* unset so we don't send them again */ > apr_table_unset(r->headers_out, "Date"); /* Avoid bogosity */ >- apr_table_unset(r->headers_out, "Server"); >+ apr_table_unset(r->headers_out, "Server"); > } > > AP_DECLARE(void) ap_basic_http_header(request_rec *r, apr_bucket_brigade *bb) >diff -ru httpd-2.0.58/server/core.c httpd-2.0.58.new/server/core.c >--- httpd-2.0.58/server/core.c 2006-04-24 19:12:21.000000000 +0200 >+++ httpd-2.0.58.new/server/core.c 2006-07-23 17:07:38.000000000 +0200 >@@ -2436,7 +2436,8 @@ > SrvTk_MINIMAL, /* eg: Apache/2.0.41 */ > SrvTk_OS, /* eg: Apache/2.0.41 (UNIX) */ > SrvTk_FULL, /* eg: Apache/2.0.41 (UNIX) PHP/4.2.2 FooBar/1.2b */ >- SrvTk_PRODUCT_ONLY /* eg: Apache */ >+ SrvTk_PRODUCT_ONLY, /* eg: Apache */ >+ SrvTk_OFF /* eg: Nothing at all */ > }; > static enum server_token_type ap_server_tokens = SrvTk_FULL; > >@@ -2491,7 +2492,10 @@ > */ > static void ap_set_version(apr_pool_t *pconf) > { >- if (ap_server_tokens == SrvTk_PRODUCT_ONLY) { >+ if (ap_server_tokens == SrvTk_OFF) { >+ ap_add_version_component(pconf, ""); >+ } >+ else if (ap_server_tokens == SrvTk_PRODUCT_ONLY) { > ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT); > } > else if (ap_server_tokens == SrvTk_MINIMAL) { >@@ -2540,6 +2544,9 @@ > else if (!strcasecmp(arg, "Prod") || !strcasecmp(arg, "ProductOnly")) { > ap_server_tokens = SrvTk_PRODUCT_ONLY; > } >+ else if (!strcasecmp(arg, "Off") ) { >+ ap_server_tokens = SrvTk_OFF; >+ } > else { > ap_server_tokens = SrvTk_FULL; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40026
:
18626
| 18629 |
18630
|
18774
|
18775