The special prefix of "/" should match any url by definition but the final
assertion which ensures that the matched prefix ends in '\0' or '/' is causing
matches against the "/" prefix to fail.
Add some extra code to handle this special case to implemented the expected
behaviour.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{
int len = strlen(prefix);
+ /* A prefix of "/" will - by definition - match any url */
+ if (prefix[0] == '/' && len == 1)
+ return true;
+
if (strncmp(url, prefix, len) != 0)
return false;