mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-25 07:00:42 +00:00
[BUG] x-original-to: name was not set in default instance
This resulted in an empty header name when option originalto
was declared in a default sections.
(cherry picked from commit b86db34fe0
)
This commit is contained in:
parent
37fc94dc42
commit
f175a6d6b1
@ -885,6 +885,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
|
||||
curproxy->fwdfor_hdr_name = strdup(defproxy.fwdfor_hdr_name);
|
||||
}
|
||||
|
||||
if (defproxy.orgto_hdr_len) {
|
||||
curproxy->orgto_hdr_len = defproxy.orgto_hdr_len;
|
||||
curproxy->orgto_hdr_name = strdup(defproxy.orgto_hdr_name);
|
||||
}
|
||||
|
||||
if (curproxy->cap & PR_CAP_FE) {
|
||||
curproxy->maxconn = defproxy.maxconn;
|
||||
curproxy->backlog = defproxy.backlog;
|
||||
@ -988,6 +993,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
|
||||
free(defproxy.iface_name);
|
||||
free(defproxy.fwdfor_hdr_name);
|
||||
defproxy.fwdfor_hdr_len = 0;
|
||||
free(defproxy.orgto_hdr_name);
|
||||
defproxy.orgto_hdr_len = 0;
|
||||
|
||||
for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
|
||||
free(defproxy.errmsg[rc].str);
|
||||
|
@ -2176,7 +2176,7 @@ int http_process_request(struct session *s, struct buffer *req)
|
||||
} else {
|
||||
len = s->fe->fwdfor_hdr_len;
|
||||
memcpy(trash, s->fe->fwdfor_hdr_name, len);
|
||||
}
|
||||
}
|
||||
len += sprintf(trash + len, ": %d.%d.%d.%d", pn[0], pn[1], pn[2], pn[3]);
|
||||
|
||||
if (unlikely(http_header_add_tail2(req, &txn->req,
|
||||
@ -2249,7 +2249,7 @@ int http_process_request(struct session *s, struct buffer *req)
|
||||
} else {
|
||||
len = s->fe->orgto_hdr_len;
|
||||
memcpy(trash, s->fe->orgto_hdr_name, len);
|
||||
}
|
||||
}
|
||||
len += sprintf(trash + len, ": %d.%d.%d.%d", pn[0], pn[1], pn[2], pn[3]);
|
||||
|
||||
if (unlikely(http_header_add_tail2(req, &txn->req,
|
||||
|
Loading…
Reference in New Issue
Block a user