mirror of https://github.com/omar-polo/gmid.git
set SERVER_NAME to the vhost when executing CGI scripts
This commit is contained in:
parent
98c8f038ac
commit
bd726b55be
|
@ -1,5 +1,7 @@
|
|||
2021-01-15 Omar Polo <op@omarpolo.com>
|
||||
|
||||
* cgi.c (start_cgi): set SERVER_NAME to the vhost when executing CGI scripts
|
||||
|
||||
* parse.y (option): add ability to specify the tls versions with "protocols"
|
||||
|
||||
* gmid.c (handle_open_conn): ensure the port number of the request matches
|
||||
|
|
5
cgi.c
5
cgi.c
|
@ -119,7 +119,10 @@ start_cgi(const char *spath, const char *relpath, const char *query,
|
|||
safe_setenv("GATEWAY_INTERFACE", "CGI/1.1");
|
||||
safe_setenv("SERVER_SOFTWARE", "gmid");
|
||||
safe_setenv("SERVER_PORT", portno);
|
||||
/* setenv("SERVER_NAME", "", 1); */
|
||||
|
||||
if (!strcmp(c->host->domain, "*"))
|
||||
safe_setenv("SERVER_NAME", c->host->domain)
|
||||
|
||||
safe_setenv("SCRIPT_NAME", spath);
|
||||
safe_setenv("SCRIPT_EXECUTABLE", ex);
|
||||
safe_setenv("REQUEST_URI", requri);
|
||||
|
|
Loading…
Reference in New Issue