mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 01:14:38 +00:00
BUG/MINOR: http_htx: Fix searching headers by substring
Function __http_find_header is used to search headers by name using specified matching method. Matching by substring returned unexpected results due to wrong length of substring supplied to strnistr function. Fixed also the boolean condition by inverting it, as we're interested in headers that contains the substring. This patch should be backported as far as 2.2
This commit is contained in:
parent
4137889911
commit
302b9f8d7a
@ -201,7 +201,7 @@ static int __http_find_header(const struct htx *htx, const void *pattern, struct
|
||||
goto next_blk;
|
||||
break;
|
||||
case HTTP_FIND_FL_MATCH_SUB:
|
||||
if (strnistr(n.ptr, n.len, name.ptr, n.len) != NULL)
|
||||
if (!strnistr(n.ptr, n.len, name.ptr, name.len))
|
||||
goto next_blk;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user