summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2020-11-18 16:44:02 +0100
committerChristopher Faulet <cfaulet@haproxy.com>2020-11-20 09:43:31 +0100
commitaab1b67383993b93bd70144825bc4350e3986a10 (patch)
tree15bc9e74bd47b5c5e069aabae7236aebfae97345
parentbdec3ba79668ff78ee882fbf77d219313fc358ff (diff)
downloadhaproxy-aab1b67383993b93bd70144825bc4350e3986a10.tar.gz
BUG/MEDIUM: http-ana: Don't eval http-after-response ruleset on empty messages
It is not possible on response comming from a server, but an errorfile may be empty. In this case, the http-after-response ruleset must not be evaluated because it is totally unexpected to manipulate headers on an empty HTX message. This patch must be backported everywhere the http-after-response rules are supported, i.e as far as 2.2.
-rw-r--r--src/http_ana.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http_ana.c b/src/http_ana.c
index 9e1708288..7a9cd0bbc 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -4556,7 +4556,7 @@ int http_forward_proxy_resp(struct stream *s, int final)
if (final) {
htx->flags |= HTX_FL_PROXY_RESP;
- if (!http_eval_after_res_rules(s))
+ if (!htx_is_empty(htx) && !http_eval_after_res_rules(s))
return 0;
if (s->txn->meth == HTTP_METH_HEAD)