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
-*- 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.
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 ]
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);
}
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);