]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: htx: make sure to always initialize the HTTP method when parsing a buffer
authorWilly Tarreau <w@1wt.eu>
Mon, 13 May 2019 06:32:31 +0000 (08:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 May 2019 08:10:44 +0000 (10:10 +0200)
smp_prefetch_htx() is used when trying to access the contents of an HTTP
buffer from the TCP rulesets. The method was not properly set in this
case, which will cause the sample fetch methods relying on the method
to randomly fail in this case.

Thanks to Tim Düsterhus for reporting this issue (#97).

This fix must be backported to 1.9.

src/http_fetch.c

index 3e6f4d1bc03cbf66b25aee2aefd8d270e7b2b3f9..2d3a381c48433952d5f404be075917903d376976 100644 (file)
@@ -270,6 +270,7 @@ struct htx *smp_prefetch_htx(struct sample *smp, struct channel *chn, int vol)
                sl = htx_add_stline(htx, HTX_BLK_REQ_SL, flags, h1sl.rq.m, h1sl.rq.u, h1sl.rq.v);
                if (!sl || !htx_add_all_headers(htx, hdrs))
                        return NULL;
+               sl->info.req.meth = h1sl.rq.meth;
        }
 
        /* OK we just got a valid HTTP message. If not already done by