summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 847ff34..477296f 100644
--- a/utils.c
+++ b/utils.c
@@ -189,3 +189,13 @@ int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen)
buf[len++] = 0;
return len;
}
+
+bool uh_path_match(const char *prefix, const char *url)
+{
+ int len = strlen(prefix);
+
+ if (strncmp(url, prefix, len) != 0)
+ return false;
+
+ return url[len] == '/' || url[len] == 0;
+}