From: Graham Leggett Date: Sat, 6 Apr 2002 13:20:48 +0000 (+0000) Subject: Remove the last little bit of the multiple-headers bug in proxy. Before, X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67567fe48c9e6cbd277b4992d50683cf4511e284;p=thirdparty%2Fapache%2Fhttpd.git Remove the last little bit of the multiple-headers bug in proxy. Before, only the last instance of a header would have been cached. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94503 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/modules/proxy/proxy_cache.c b/src/modules/proxy/proxy_cache.c index 73c2d733231..51464011fb9 100644 --- a/src/modules/proxy/proxy_cache.c +++ b/src/modules/proxy/proxy_cache.c @@ -872,17 +872,13 @@ static int sub_garbage_coll(request_rec *r, array_header *files, r->status = c->status; /* Prepare and send headers to client */ - ap_overlap_tables(r->headers_out, c->hdrs, AP_OVERLAP_TABLES_SET); + ap_proxy_table_replace(r->headers_out, c->hdrs); /* make sure our X-Cache header does not stomp on a previous header */ ap_table_mergen(r->headers_out, "X-Cache", c->xcache); /* content type is already set in the headers */ r->content_type = ap_table_get(r->headers_out, "Content-Type"); - /* cookies are special: they must not be merged (stupid browsers) */ - ap_proxy_table_unmerge(r->pool, r->headers_out, "Set-Cookie"); - ap_proxy_table_unmerge(r->pool, r->headers_out, "Set-Cookie2"); - ap_send_http_header(r); /* are we rewriting the cache file? */ diff --git a/src/modules/proxy/proxy_util.c b/src/modules/proxy/proxy_util.c index b5b1facd253..65ae84601f7 100644 --- a/src/modules/proxy/proxy_util.c +++ b/src/modules/proxy/proxy_util.c @@ -1519,35 +1519,6 @@ int ap_proxy_table_replace(table *base, table *overlay) return q; } -/* unmerge an element in the table */ -void ap_proxy_table_unmerge(pool *p, table *t, char *key) -{ - long int offset = 0; - long int count = 0; - char *value = NULL; - - /* get the value to unmerge */ - const char *initial = ap_table_get(t, key); - if (!initial) { - return; - } - value = ap_pstrdup(p, initial); - - /* remove the value from the headers */ - ap_table_unset(t, key); - - /* find each comma */ - while (value[count]) { - if (value[count] == ',') { - value[count] = 0; - ap_table_add(t, key, value + offset); - offset = count + 1; - } - count++; - } - ap_table_add(t, key, value + offset); -} - #if defined WIN32 static DWORD tls_index;