]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-fetch: Update method after a prefetch in smp_fetch_meth()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Oct 2022 06:58:02 +0000 (08:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Oct 2022 07:16:36 +0000 (09:16 +0200)
In smp_fetch_meth(), smp_prefetch_htx() function may be called to parse the
HTX message and update the HTTP transaction accordingly. In this case, in
smp_fetch_metch() and on success, we must update "meth" variable. Otherwise,
the variable is still equal to HTTP_METH_OTHER and the string version is
always used instead of the enum for known methods.

This patch must be backported as far as 2.0.

src/http_fetch.c

index ddfb2222d4962a68ceee10033692d9b553c28d49..1579b4ede925fb24a77b696652ce824d89fb006e 100644 (file)
@@ -346,6 +346,7 @@ static int smp_fetch_meth(const struct arg *args, struct sample *smp, const char
                htx = smp_prefetch_htx(smp, chn, NULL, 1);
                if (!htx)
                        return 0;
+               meth = txn->meth;
        }
 
        smp->data.type = SMP_T_METH;