From 1eb3b4828e1559cb4a46f2d528b898cf6eb9898f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 31 Oct 2019 15:50:28 +0100 Subject: [PATCH] BUG/MINOR: stats: properly check the path and not the whole URI 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/http_ana.c b/src/http_ana.c index c16d61f9b..715dcc7c1 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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)