summaryrefslogtreecommitdiff
path: root/url.h
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2023-08-17 18:10:02 +0200
committerVincent Douillet <vincent@vdouillet.fr>2023-08-19 17:49:54 +0200
commit7caf4597bcfb64dac04b7190dab1022f1bc4e141 (patch)
treee754d4e5bd0799dcac12ea3dc77e2f8a7b10ed54 /url.h
parent1970c9982e99daa26f7fc4c6f16b441a0aa806de (diff)
file download poc
Diffstat (limited to 'url.h')
-rw-r--r--url.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/url.h b/url.h
index 7bfa247..b4552a7 100644
--- a/url.h
+++ b/url.h
@@ -31,8 +31,19 @@
#ifndef URL_H
#define URL_H
+#include <stdbool.h>
#include <stdio.h>
+#define URL_LENGTH_MAX 8192
+
+/*
+ * Checks that the path can be safely processed. Namely, it should not contain
+ * "..", which denotes an attempt to get out of the DATA_DIR root folder.
+ * The path is required.
+ */
+bool
+check_request_path(char *);
+
/*
* Build an URL from the provided components.
* The first argument is the destination buffer where the URL will be written.