diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-08-12 20:54:03 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-08-12 20:54:03 +0200 |
commit | 188dea23edf8b1646c662fa6ab8119f156da49a5 (patch) | |
tree | f7c655985718e1f7d03ada7023226fdd602cee76 | |
parent | c5eac5d27fb3967d796fe3c75f4cc1bdcd18ed01 (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |