]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Propose solution via addition directive option.
authorJim Jagielski <jim@apache.org>
Fri, 7 May 2004 21:49:34 +0000 (21:49 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 7 May 2004 21:49:34 +0000 (21:49 +0000)
PR:
Obtained from:
Submitted by:
Reviewed by:

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

STATUS
modules/proxy/proxy_http.c

diff --git a/STATUS b/STATUS
index 914c86452561edc2debd2013a13b2d0984582861..18c38b2e43df40afe3f01dc4ccfcf07c15bb0a27 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/05/05 16:29:58 $]
+Last modified at [$Date: 2004/05/07 21:49:34 $]
 
 Release:
 
@@ -361,6 +361,9 @@ PATCHES TO BACKPORT FROM 2.1
          wouldn't be listening on any port so it wouldn't matter anyway.
          nd replies: But if it can't be 0 the alternatives thereafter make no
            sense anymore, right?
+        jim proposes: UseCanonicalName Client directive
+          which implements this, keeping UseCanonicalName Off
+          "as is". 
 
     * mod_isapi: send_response_header() failed to copy status string's 
       last character.  PR 20619.  [Jesse Pelton <jsp pkc.com>]
index 39acc6eaa3e6e48f2f78187073e411e2bcd68984..3c878b1b80c4877b08e1c26901b97a3d8110e913 100644 (file)
@@ -643,6 +643,12 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
     return APR_SUCCESS;
 }
 
+static int addit_dammit(void *v, const char *key, const char *val)
+{
+    apr_table_addn(v, key, val);
+    return 1;
+}
+
 static
 apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                                             proxy_http_conn_t *p_conn,
@@ -662,6 +668,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                                 * in the case that the origin told us
                                 * to HTTP_CONTINUE
                                 */
+    apr_table_t *save_table;
 
     /* Get response from the remote server, and pass it up the
      * filter chain
@@ -733,8 +740,14 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers*/
             /* Also, take care with headers with multiple occurences. */
 
+            /* First, tuck away all already existing cookies */
+            save_table = apr_table_make(r->pool, 2);
+            apr_table_do(addit_dammit, save_table, r->err_headers_out, "Set-Cookie", NULL);
+            apr_table_do(addit_dammit, save_table, r->headers_out, "Set-Cookie", NULL);
+
             r->headers_out = ap_proxy_read_headers(r, rp, buffer,
                                                    sizeof(buffer), origin);
+
             if (r->headers_out == NULL) {
                 ap_log_error(APLOG_MARK, APLOG_WARNING, 0,
                              r->server, "proxy: bad HTTP/%d.%d header "
@@ -752,8 +765,19 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                 return r->status;
 
             } else {
-                /* strip connection listed hop-by-hop headers from response */
                 const char *buf;
+
+                /* Now, add in the just read cookies */
+                apr_table_do(addit_dammit, save_table, r->headers_out, "Set-Cookie", NULL);
+
+                /* and now load 'em all in */
+                if (!apr_is_empty_table(save_table)) {
+                    apr_table_unset(r->headers_out, "Set-Cookie");
+                    r->headers_out = apr_table_overlay(r->pool,
+                                                           r->headers_out, save_table);
+                }
+                
+                /* strip connection listed hop-by-hop headers from response */
                 p_conn->close += ap_proxy_liststr(apr_table_get(r->headers_out,
                                                                 "Connection"),
                                                   "close");