projects
/
project
/
uhttpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5eac5d
)
utils: accept '?' as path terminator in uh_path_match()
author
Jo-Philipp Wich
<
[email protected]
>
Fri, 12 Aug 2022 18:54:03 +0000
(20:54 +0200)
committer
Jo-Philipp Wich
<
[email protected]
>
Fri, 12 Aug 2022 18:54:03 +0000
(20:54 +0200)
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 <
[email protected]
>
utils.c
patch
|
blob
|
history
diff --git
a/utils.c
b/utils.c
index 142a410ff6915b69d3a3a0ef0ebb9d8746e2c4b8..6502d948f7d8c9766fac463d87495dbbd53401fa 100644
(file)
--- 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)