[mod_cgi] always set QUERY_STRING (fixes #1339)

(thx alexo)

x-ref:
  "lighttpd doesn't set empty QUERY_STRING in cgi environment"
  https://redmine.lighttpd.net/issues/1339
This commit is contained in:
Glenn Strauss 2016-04-12 23:48:14 -04:00
parent 97556d992b
commit f1681ca29b
2 changed files with 3 additions and 0 deletions

1
NEWS
View File

@ -63,6 +63,7 @@ NEWS
* [stream] fstat() after open() to obtain file size
* [core] clean up srv before exiting for lighttpd -[vVh]
* [mod_fastcgi,mod_scgi] check for spawning on same unix socket (fixes #319)
* [mod_cgi] always set QUERY_STRING (fixes #1339)
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)

View File

@ -956,6 +956,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
cgi_env_add(&env, CONST_STR_LEN("REDIRECT_STATUS"), CONST_STR_LEN("200"));
if (!buffer_string_is_empty(con->uri.query)) {
cgi_env_add(&env, CONST_STR_LEN("QUERY_STRING"), CONST_BUF_LEN(con->uri.query));
} else {
cgi_env_add(&env, CONST_STR_LEN("QUERY_STRING"), CONST_STR_LEN(""));
}
if (!buffer_string_is_empty(con->request.orig_uri)) {
cgi_env_add(&env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));