From 2adcdbacc2f00e1797564b392f30a1b661658a17 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 1 Apr 2026 14:00:24 +0200 Subject: [PATCH] MINOR: action: Add a sample expression field in arguments used by HTTP actions This could be useful for some HTTP actions. It was possible to rely on a log-format string. It is now possible to also use a sample expression. --- include/haproxy/action-t.h | 1 + src/http_act.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/haproxy/action-t.h b/include/haproxy/action-t.h index 984f55c64..490005c71 100644 --- a/include/haproxy/action-t.h +++ b/include/haproxy/action-t.h @@ -151,6 +151,7 @@ struct act_rule { struct ist str; /* string param (reason, header name, ...) */ struct lf_expr fmt; /* log-format compatible expression */ struct my_regex *re; /* used by replace-header/value/uri/path */ + struct sample_expr *expr; /* sample expression used by HTTP action */ } http; /* args used by some HTTP rules */ struct http_reply *http_reply; /* HTTP response to be used by return/deny/tarpit rules */ struct redirect_rule *redir; /* redirect rule or "http-request redirect" */ diff --git a/src/http_act.c b/src/http_act.c index b8d3ce3fb..514d20173 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -51,6 +51,7 @@ static void release_http_action(struct act_rule *rule) if (rule->arg.http.re) regex_free(rule->arg.http.re); lf_expr_deinit(&rule->arg.http.fmt); + release_sample_expr(rule->arg.http.expr); } /* Release memory allocated by HTTP actions relying on an http reply. Concretely, -- 2.47.3