CGI: for PATH_INFO use the path relative to the base directory - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit c436fc10abe28f4c60a480cad787f619a3724336
(DIR) parent 9b695d406cbc9c2d9ffddb7a086d44d22f0623ad
(HTM) 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:
M handlr.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
---
(DIR) 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 = "";