commit c436fc10abe28f4c60a480cad787f619a3724336
parent 9b695d406cbc9c2d9ffddb7a086d44d22f0623ad
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 7 Apr 2023 12:16:08 +0200
CGI: for PATH_INFO use the path relative to the base directory
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/handlr.c b/handlr.c
@@ -149,9 +149,7 @@ handlecgi(int sock, char *file, char *port, char *base, char *args,
path = NULL;
}
- p = strrchr(file, '/');
- if (p == NULL)
- p = file;
+ p = makebasepath(file, base);
if (sear == NULL)
sear = "";
@@ -209,9 +207,7 @@ handledcgi(int sock, char *file, char *port, char *base, char *args,
path = NULL;
}
- p = strrchr(file, '/');
- if (p == NULL)
- p = file;
+ p = makebasepath(file, base);
if (sear == NULL)
sear = "";