]> granicus.if.org Git - apache/commitdiff
Change the header merging behaviour in proxy, as some headers
authorGraham Leggett <minfrin@apache.org>
Thu, 21 Mar 2002 12:05:45 +0000 (12:05 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 21 Mar 2002 12:05:45 +0000 (12:05 +0000)
(like Set-Cookie) cannot be unmerged due to stray commas in
dates.
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94083 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy.c
modules/proxy/proxy_http.c
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index f6214bd822182c82002653c915c688a25ea2db1d..c8a3dad9a98abd6578e53ec7c9429c0568b4a065 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.34-dev
 
+  *) Change the header merging behaviour in proxy, as some headers
+     (like Set-Cookie) cannot be unmerged due to stray commas in
+     dates. [Graham Leggett]
+
   *) Be more vocal about what AcceptMutex values we allow, to make
      us closer to how 1.3 does it. [Jim Jagielski]
 
index a53912ae8167bc80287b18205cde464d3382576f..5daef69d5b31128754daf45e665f489775ef6902 100644 (file)
@@ -854,7 +854,7 @@ static const char *
     ap_get_module_config(parms->server->module_config, &proxy_module);
     long s = atol(arg);
 
-    psf->io_buffer_size = MAX(s, AP_IOBUFSIZE);
+    psf->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE);
     psf->io_buffer_size_set = 1;
     return NULL;
 }
index 33a3705baa6738e10cb86483d5f1459fe3677630..e57ffc3ea96b84260367e90cd4d55d935c1e22ba 100644 (file)
@@ -781,10 +781,6 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             }
         }
 
-        /* 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");
-
         r->sent_bodyct = 1;
         /* Is it an HTTP/0.9 response? If so, send the extra data */
         if (backasswards) {
index bf1c85b1904ce1a06ffb3156e8b3bc62f72533d7..7ce7f318de120c6cc232e79c1013cc55bf971a4c 100644 (file)
@@ -392,8 +392,11 @@ PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r)
  * Reads headers from a buffer and returns an array of headers.
  * Returns NULL on file error
  * This routine tries to deal with too long lines and continuation lines.
- * @@@: XXX: FIXME: currently the headers are passed thru un-merged. 
- * Is that okay, or should they be collapsed where possible?
+ *
+ * Note: Currently the headers are passed through unmerged. This has to be
+ * done so that headers which react badly to merging (such as Set-Cookie
+ * headers, which contain commas within the date field) do not get stuffed
+ * up.
  */
 PROXY_DECLARE(apr_table_t *)ap_proxy_read_headers(request_rec *r, request_rec *rr, char *buffer, int size, conn_rec *c)
 {
@@ -441,8 +444,8 @@ PROXY_DECLARE(apr_table_t *)ap_proxy_read_headers(request_rec *r, request_rec *r
        for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end)
            *end = '\0';
 
-        /* make sure we merge so as not to destroy duplicated headers */
-        apr_table_merge(headers_out, buffer, value);
+        /* make sure we add so as not to destroy duplicated headers */
+        apr_table_add(headers_out, buffer, value);
 
        /* the header was too long; at the least we should skip extra data */
        if (len >= size - 1) {