From: Tim Duesterhus Date: Fri, 3 Jul 2020 11:43:42 +0000 (+0200) Subject: BUG/MINOR: http_act: don't check capture id in backend (2) X-Git-Tag: v2.1.8~47 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=4cbc30d405b06e7ff1ba6a6f3be58af786af81bc;p=haproxy-2.1.git BUG/MINOR: http_act: don't check capture id in backend (2) Please refer to commit 19a69b3740702ce5503a063e9dfbcea5b9187d27 for all the details. This follow up commit fixes the `http-response capture` case, the previous one only fixed the `http-request capture` one. The documentation was already updated and the change to `check_http_res_capture` is identical to the `check_http_req_capture` change. This patch must be backported together with 19a69b3740702ce5503a063e9dfbcea5b9187d27. Most likely this is 1.6+. (cherry picked from commit f3f4aa0266809c729ca98171a34de8c9bdd2c9f3) Signed-off-by: Christopher Faulet --- diff --git a/src/http_act.c b/src/http_act.c index a5e0dda..1105d59 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -609,7 +609,10 @@ static int check_http_res_capture(struct act_rule *rule, struct proxy *px, char if (rule->action_ptr != http_action_res_capture_by_id) return 1; - if (rule->arg.capid.idx >= px->nb_rsp_cap) { + /* capture slots can only be declared in frontends, so we can't check their + * existence in backends at configuration parsing step + */ + if (px->cap & PR_CAP_FE && rule->arg.capid.idx >= px->nb_rsp_cap) { memprintf(err, "unable to find capture id '%d' referenced by http-response capture rule", rule->arg.capid.idx); return 0;