BUG/MINOR: http-fetch: Extract cookie value even when no cookie name
authorMaciej Zdeb <maciej@zdeb.pl>
Fri, 13 Nov 2020 09:38:06 +0000 (09:38 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 15:52:10 +0000 (16:52 +0100)
commita862430878f4435a1a64926e945501d737f7babd
tree5519379c9d64de083e0152cfa0fd7a4e12c61fc7
parentc3983501586f5dc349d563e6ea906e5e23f69d95
BUG/MINOR: http-fetch: Extract cookie value even when no cookie name

HTTP sample fetches dealing with the cookies (req/res.cook,
req/res.cook_val and req/res.cook_cnt) must be prepared to be called
without cookie name. For the first two, the first cookie value is
returned, regardless its name. For the last one, all cookies are counted.

To do so, http_extract_cookie_value() may now be called with no cookie
name (cookie_name_l set to 0). In this case, the matching on the cookie
name is ignored and the first value found is returned.

Note this patch also fixes matching on cookie values in ACLs.

This should be backported in all stable versions.

(cherry picked from commit dea7c209f8a77b471323dd97bdc1ac4d7a17b812)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 8cac341124e2b79c2a924ad186a114b39546298e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 02b89eadd7a7ddbaad88c5725b0a215d2d8c1d81)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http.c
src/http_fetch.c