BUG/MINOR: http_htx: Fix searching headers by substring
authorMaciej Zdeb <maciej@zdeb.pl>
Fri, 20 Nov 2020 12:12:24 +0000 (12:12 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Nov 2020 13:42:52 +0000 (14:42 +0100)
commitf77465cb8e22a3793141df63ee28af670316930d
treeee78e5f9073b2b834304ee7c26d3babf9710260c
parentd5d6214affa61ecda453d506e8aaf82befa5c2dd
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

(cherry picked from commit 302b9f8d7a3805bfd25ecf267a8ddd730c6887b3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_htx.c