]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http-ana: Don't eval http-after-response ruleset on empty messages
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Nov 2020 15:44:02 +0000 (16:44 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Nov 2020 08:43:31 +0000 (09:43 +0100)
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.

src/http_ana.c

index 9e170828822eb9614f98a7f57e7b4e8982364692..7a9cd0bbcc7c38a1bcb36943824b023b933aea8c 100644 (file)
@@ -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)