summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-08-12 20:54:03 +0200
committerJo-Philipp Wich <jo@mein.io>2022-08-12 20:54:03 +0200
commit188dea23edf8b1646c662fa6ab8119f156da49a5 (patch)
treef7c655985718e1f7d03ada7023226fdd602cee76
parentc5eac5d27fb3967d796fe3c75f4cc1bdcd18ed01 (diff)
downloaduhttpd2-188dea23edf8b1646c662fa6ab8119f156da49a5.tar.gz
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 <jo@mein.io>
-rw-r--r--utils.c2
1 files changed, 1 insertions, 1 deletions
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)