mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 06:40:59 +01:00
[MINOR] acl: permit to return any header when no name specified
Having the ability to match on hdr_xxx in addition to hdr_xxx(yyy) makes it possible to match any value or to count the headers easily.
This commit is contained in:
parent
737b0c12a6
commit
1ad7c6dd85
@ -495,6 +495,14 @@ int http_find_header2(const char *name, int len,
|
|||||||
while (cur_idx) {
|
while (cur_idx) {
|
||||||
eol = sol + idx->v[cur_idx].len;
|
eol = sol + idx->v[cur_idx].len;
|
||||||
|
|
||||||
|
if (len == 0) {
|
||||||
|
/* No argument was passed, we want any header.
|
||||||
|
* To achieve this, we simply build a fake request. */
|
||||||
|
while (sol + len < eol && sol[len] != ':')
|
||||||
|
len++;
|
||||||
|
name = sol;
|
||||||
|
}
|
||||||
|
|
||||||
if ((len < eol - sol) &&
|
if ((len < eol - sol) &&
|
||||||
(sol[len] == ':') &&
|
(sol[len] == ':') &&
|
||||||
(strncasecmp(sol, name, len) == 0)) {
|
(strncasecmp(sol, name, len) == 0)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user