]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r580044, r580465 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 8 Oct 2007 12:47:12 +0000 (12:47 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 8 Oct 2007 12:47:12 +0000 (12:47 +0000)
Strip hop-by-hop headers in proxy response

Fix typo in header name "Trailer"

Submitted by: niq
Reviewed by: jim

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

CHANGES
STATUS
modules/proxy/mod_proxy_http.c

diff --git a/CHANGES b/CHANGES
index e98bf38eca2c5b3c141e3fbf8487793cc8fd76d3..fb511761ce6fcb9abd9edf48e464d50d34e3a0b4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) mod_proxy_http: strip hop-by-hop response headers
+     PR 43455 [Nick Kew]
+
   *) mod_proxy: Don't by default violate RFC2616 by setting
      Max-Forwards when the client didn't send it to us.
      Leave that as a configuration option.
diff --git a/STATUS b/STATUS
index 30fcde1b39017ff4fa51e2fb81f170bd16c0dd3c..cf8f735c8c152e1f1a8773c2ccc3a95bb374b49d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,11 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_proxy_http: strip hop-by-hop response headers
-     PR 43455
-     http://svn.apache.org/viewvc?view=rev&revision=580044
-     http://svn.apache.org/viewvc?view=rev&revision=580465
-     +1: niq, rpluem, jim
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 9617be8c3b0d56ad088b21ba423d32ff0560281c..cc1d8ce7f7c1d0bcbffd8f5deb0cb60f193bc009 100644 (file)
@@ -1235,6 +1235,9 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
     int pread_len = 0;
     apr_table_t *save_table;
     int backend_broke = 0;
+    static const char *hop_by_hop_hdrs[] =
+        {"Keep-Alive", "Proxy-Authenticate", "TE", "Trailer", "Upgrade", NULL};
+    int i;
 
     bb = apr_brigade_create(p, c->bucket_alloc);
 
@@ -1375,6 +1378,11 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             }
             ap_proxy_pre_http_request(origin,rp);
 
+            /* Clear hop-by-hop headers */
+            for (i=0; hop_by_hop_hdrs[i]; ++i) {
+                apr_table_unset(r->headers_out, hop_by_hop_hdrs[i]);
+            }
+
             /* handle Via header in response */
             if (conf->viaopt != via_off && conf->viaopt != via_block) {
                 const char *server_name = ap_get_server_name(r);