MINOR: http: Remove headers matching the name of http-send-name-header option
It is not explicitly stated in the documentation, but some users rely on this
behavior. When the server name is inserted in a request, headers with the same
name are first removed.
This patch is not tagged as a bug, because it is not explicitly documented. We
choose to keep the same implicit behavior to not break existing
configuration. Because this option is used very little, it is not a big deal.
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index d66c8af..c459e76 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -1588,6 +1588,11 @@
if (isteq(p.n, ist("host")))
params.srv_name = p.v;
+ /* Skip header if same name is used to add the server name */
+ if (fconn->proxy->server_id_hdr_name &&
+ isteq(p.n, ist2(fconn->proxy->server_id_hdr_name, fconn->proxy->server_id_hdr_len)))
+ break;
+
memcpy(trash.area, "http_", 5);
memcpy(trash.area+5, p.n.ptr, p.n.len);
p.n = ist2(trash.area, p.n.len+5);