From 188dea23edf8b1646c662fa6ab8119f156da49a5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 12 Aug 2022 20:54:03 +0200 Subject: utils: accept '?' as path terminator in uh_path_match() When matching prefixes against the request URL, we should accept '?' as valid terminator, similar to '/' and '\0' since logically the query string is not part of the requested path. Signed-off-by: Jo-Philipp Wich --- utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.c b/utils.c index 142a410..6502d94 100644 --- a/utils.c +++ b/utils.c @@ -215,7 +215,7 @@ bool uh_path_match(const char *prefix, const char *url) if (strncmp(url, prefix, len) != 0) return false; - return url[len] == '/' || url[len] == 0; + return url[len] == '/' || url[len] == '?' || url[len] == 0; } char *uh_split_header(char *str) -- cgit v1.2.3