summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--modules/proxy/mod_proxy.c9
-rw-r--r--modules/proxy/mod_proxy.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index e0d55ce253..d025033ea6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
-*- coding: utf-8 -*-
Changes with Apache 2.4.28
+ *) mod_proxy: Fix ProxyAddHeaders merging. [Joe Orton]
+
*) core: Disallow multiple Listen on the same IP:port when listener buckets
are configured (ListenCoresBucketsRatio > 0), consistently with the single
bucket case (default), thus avoiding the leak of the corresponding socket
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
index f6fb473ed1..9f5a3ae279 100644
--- a/modules/proxy/mod_proxy.c
+++ b/modules/proxy/mod_proxy.c
@@ -1451,6 +1451,7 @@ static void *create_proxy_dir_config(apr_pool_t *p, char *dummy)
new->error_override = 0;
new->error_override_set = 0;
new->add_forwarded_headers = 1;
+ new->add_forwarded_headers_set = 0;
return (void *) new;
}
@@ -1482,7 +1483,12 @@ static void *merge_proxy_dir_config(apr_pool_t *p, void *basev, void *addv)
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;
}
@@ -1970,6 +1976,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 *
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
index 8a0ad10259..4f31bed389 100644
--- a/modules/proxy/mod_proxy.h
+++ b/modules/proxy/mod_proxy.h
@@ -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;