mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-02 03:23:12 +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.
This commit is contained in:
parent
b21570ae0f
commit
b86db34fe0
@ -930,6 +930,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
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;
|
||||
@ -1034,6 +1039,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
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++)
|
||||
chunk_destroy(&defproxy.errmsg[rc]);
|
||||
|
@ -2528,7 +2528,7 @@ int http_process_request(struct session *s, struct buffer *req, int an_bit)
|
||||
} 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,
|
||||
@ -2601,7 +2601,7 @@ int http_process_request(struct session *s, struct buffer *req, int an_bit)
|
||||
} 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