]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: properly check the path and not the whole URI
authorWilly Tarreau <w@1wt.eu>
Thu, 31 Oct 2019 14:50:28 +0000 (15:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Oct 2019 14:52:14 +0000 (15:52 +0100)
Since we now have full URIs with h2, stats may fail to work over H2
so we must carefully only check the path there if the stats URI was
passed with a path only. This way it remains possible to intercept
proxy requests to report stats on explicit domains but it continues
to work as expected on origin requests.

No backport needed.

src/http_ana.c

index c16d61f9bd8957a535c0253457132f18a134c811..715dcc7c16ff97215f62e66d6f1f89d64446637d 100644 (file)
@@ -4340,6 +4340,8 @@ static int http_stats_check_uri(struct stream *s, struct http_txn *txn, struct p
        htx = htxbuf(&s->req.buf);
        sl = http_get_stline(htx);
        uri = htx_sl_req_uri(sl);
+       if (*uri_auth->uri_prefix == '/')
+               uri = http_get_path(uri);
 
        /* check URI size */
        if (uri_auth->uri_len > uri.len)