Browse Source

[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
personal/stbuehler/mod-csrf-old
Glenn Strauss 6 years ago
parent
commit
f1681ca29b
  1. 1
      NEWS
  2. 2
      src/mod_cgi.c

1
NEWS

@ -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)

2
src/mod_cgi.c

@ -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));

Loading…
Cancel
Save