commit 54c7a0123a051c8e2b133fd82f67ce9a488cfbe1
parent 9a60f50376f783775540e9b61b41e75e7769a922
Author: Francesco Saccone <francesco@francescosaccone.com>
Date: Tue, 1 Apr 2025 12:41:10 +0200
fix: add / to index path only when request is not '/'
Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c
@@ -225,7 +225,9 @@ main(int argc, char *argv[]) {
index_path[0] = '\0';
strcat(index_path, normalised_path);
- strcat(index_path, "/");
+ if (strcmp(normalised_path, "/") != 0) {
+ strcat(index_path, "/");
+ }
strcat(index_path, directory_index);
normalised_index_path = get_normalised_path(