Add legacy backwards compatibility for CGI scripts. - geomyidae - A small C-based gopherd.
HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 5933c8faa2d627cf6c4cb6703a4ff9fb04754600
DIR parent 2452013f44d23c294bd6a95d5ebc390a6fdd1789
HTML Author: Christoph Lohmann <20h@r-36.net>
Date: Fri, 12 Jun 2020 23:51:14 +0200
Add legacy backwards compatibility for CGI scripts.
Diffstat:
M ind.c | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
---
DIR diff --git a/ind.c b/ind.c
@@ -480,7 +480,12 @@ setcgienviron(char *file, char *path, char *port, char *base, char *args,
/* TODO: Separate, if run like rest.dcgi. */
setenv("PATH_INFO", file, 1);
setenv("PATH_TRANSLATED", path, 1);
+
setenv("QUERY_STRING", args, 1);
+ /* legacy compatibility */
+ setenv("SELECTOR", args, 1);
+ setenv("REQUEST", args, 1);
+
setenv("REMOTE_ADDR", chost, 1);
/*
* Don't do a reverse lookup on every call. Only do when needed, in
@@ -504,6 +509,8 @@ setcgienviron(char *file, char *path, char *port, char *base, char *args,
setenv("SERVER_SOFTWARE", "geomyidae", 1);
setenv("X_GOPHER_SEARCH", sear, 1);
+ /* legacy compatibility */
+ setenv("SEARCHREQUEST", sear, 1);
if (istls) {
setenv("GOPHERS", "on", 1);