Browse Source

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>
Jo-Philipp Wich 1 year ago
parent
commit
188dea23ed
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils.c

+ 1 - 1
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)