diff --git a/ChangeLog b/ChangeLog index f45d772..845ff6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2021-01-15 Omar Polo + * 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 diff --git a/cgi.c b/cgi.c index 899932f..30f554c 100644 --- a/cgi.c +++ b/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);