mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-24 05:32:21 +00:00
BUG/MINOR: http_ext: fix if-none regression in forwardfor option
A regression was introduced in730b983
("MINOR: proxy: move 'forwardfor' option to http_ext") Indeed, when the forwardfor if-none option is specified on the frontend but forwardfor is not specified at all on the backend: if-none from the frontend is ignored. But this behavior conflicts with the historical one, if-none should only be ignored if forwardfor is also enabled on the backend and if-none is not set there. It should fix GH #2187. This should be backported in 2.8 with730b983
("MINOR: proxy: move 'forwardfor' option to http_ext")
This commit is contained in:
parent
a150cfcfec
commit
d35cee972b
@ -790,8 +790,8 @@ int http_handle_xff_header(struct stream *s, struct channel *req)
|
|||||||
struct http_hdr_ctx ctx = { .blk = NULL };
|
struct http_hdr_ctx ctx = { .blk = NULL };
|
||||||
struct ist hdr = ((b_xff) ? b_xff->hdr_name : f_xff->hdr_name);
|
struct ist hdr = ((b_xff) ? b_xff->hdr_name : f_xff->hdr_name);
|
||||||
|
|
||||||
if (f_xff && f_xff->mode == HTTP_XFF_IFNONE &&
|
if ((!f_xff || f_xff->mode == HTTP_XFF_IFNONE) &&
|
||||||
b_xff && b_xff->mode == HTTP_XFF_IFNONE &&
|
(!b_xff || b_xff->mode == HTTP_XFF_IFNONE) &&
|
||||||
http_find_header(htx, hdr, &ctx, 0)) {
|
http_find_header(htx, hdr, &ctx, 0)) {
|
||||||
/* The header is set to be added only if none is present
|
/* The header is set to be added only if none is present
|
||||||
* and we found it, so don't do anything.
|
* and we found it, so don't do anything.
|
||||||
|
Loading…
Reference in New Issue
Block a user