httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1805099 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h
Date Tue, 15 Aug 2017 16:54:22 GMT
Author: jorton
Date: Tue Aug 15 16:54:22 2017
New Revision: 1805099

URL: http://svn.apache.org/viewvc?rev=1805099&view=rev
Log:
Fix ProxyAddHeaders merging.

* modules/proxy/mod_proxy.h:
  Add add_forwarded_headers_set field to proxy_dir_conf.

* modules/proxy/mod_proxy.c (create_proxy_dir_config, ):
  Initialize add_forwarded_headers_set.
  (add_proxy_http_headers): Set it.
  (merge_proxy_dir_config): Merge add_forwarded_headers correctly.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1805099&r1=1805098&r2=1805099&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Aug 15 16:54:22 2017
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy: Fix ProxyAddHeaders merging.  [Joe Orton]
+
   *) mod_md: new module for managing domains across VirtualHosts with ACME protocol 
      implementation for automated certificate signup and renewal. Default CA is
      the test area of Let's Encrypt right now, so certificates root will not be valid.

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1805099&r1=1805098&r2=1805099&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Tue Aug 15 16:54:22 2017
@@ -1568,6 +1568,7 @@ static void *create_proxy_dir_config(apr
     new->error_override = 0;
     new->error_override_set = 0;
     new->add_forwarded_headers = 1;
+    new->add_forwarded_headers_set = 0;
 
     return (void *) new;
 }
@@ -1599,7 +1600,12 @@ static void *merge_proxy_dir_config(apr_
     new->error_override_set = add->error_override_set || base->error_override_set;
     new->alias = (add->alias_set == 0) ? base->alias : add->alias;
     new->alias_set = add->alias_set || base->alias_set;
-    new->add_forwarded_headers = add->add_forwarded_headers;
+    new->add_forwarded_headers =
+        (add->add_forwarded_headers_set == 0) ? base->add_forwarded_headers
+        : add->add_forwarded_headers;
+    new->add_forwarded_headers_set = add->add_forwarded_headers_set
+        || base->add_forwarded_headers_set;
+    
     return new;
 }
 
@@ -2102,6 +2108,7 @@ static const char *
 {
    proxy_dir_conf *conf = dconf;
    conf->add_forwarded_headers = flag;
+   conf->add_forwarded_headers_set = 1;
    return NULL;
 }
 static const char *

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1805099&r1=1805098&r2=1805099&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Tue Aug 15 16:54:22 2017
@@ -235,6 +235,7 @@ typedef struct {
     unsigned int error_override_set:1;
     unsigned int alias_set:1;
     unsigned int add_forwarded_headers:1;
+    unsigned int add_forwarded_headers_set:1;
 
     /** Named back references */
     apr_array_header_t *refs;



Mime
View raw message