From: Jo-Philipp Wich Date: Fri, 12 Aug 2022 18:54:03 +0000 (+0200) Subject: utils: accept '?' as path terminator in uh_path_match() X-Git-Url: http://git.openwrt.org/openwrt/feeds.git?p=project%2Fuhttpd.git;a=commitdiff_plain;h=188dea23edf8b1646c662fa6ab8119f156da49a5 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 --- 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)