]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Tighten up the overridden-Server-header bugfix in the proxy, by
authorGraham Leggett <minfrin@apache.org>
Mon, 25 Mar 2002 22:45:05 +0000 (22:45 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 25 Mar 2002 22:45:05 +0000 (22:45 +0000)
only overriding if the request is a proxy request. It has been
pointed out that the previous fix allows CGIs and modules to
override the Server header, which is change to previous behavior.
PR:
Obtained from:
Submitted by: Graham Leggett, Joshua Slive
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94165 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/main/http_protocol.c

index 5a6cbe3914d05ca3ea2a11922a4c07aa34156b4d..1b9b9a80462ae9b6ffa86c948bd008856477e58f 100644 (file)
@@ -1,5 +1,11 @@
 Changes with Apache 1.3.25
 
+  *) Tighten up the overridden-Server-header bugfix in the proxy, by
+     only overriding if the request is a proxy request. It has been
+     pointed out that the previous fix allows CGIs and modules to
+     override the Server header, which is change to previous behavior.
+     [Graham Leggett, Joshua Slive]
+
   *) Another fix for the multiple-cookie header bug in proxy. With some
      luck this bug is actually now dead. [Graham Leggett]
 
index 7da84f785b3e96c3b4dc645af9d9e30a3acf3cf2..0373a490c1f381c7884f53aad1834fee17fd5873 100644 (file)
@@ -1513,7 +1513,6 @@ API_EXPORT_NONSTD(int) ap_send_header_field(request_rec *r,
 API_EXPORT(void) ap_basic_http_header(request_rec *r)
 {
     char *protocol;
-    const char *server;
 
     if (r->assbackwards)
         return;
@@ -1542,10 +1541,13 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r)
     /* output the date header */
     ap_send_header_field(r, "Date", ap_gm_timestr_822(r->pool, r->request_time));
 
-    /* keep a previously set server header (possible from proxy), otherwise
+    /* keep the set-by-proxy server header, otherwise
      * generate a new server header */
-    if (server = ap_table_get(r->headers_out, "Server")) {
-        ap_send_header_field(r, "Server", server);
+    if (r->proxyreq) {
+        const char *server = ap_table_get(r->headers_out, "Server");
+        if (server) {
+            ap_send_header_field(r, "Server", server);
+        }
     }
     else {
         ap_send_header_field(r, "Server", ap_get_server_version());