[core] do not emit req/response hdrs w/ blank val

personal/stbuehler/mod-csrf
Glenn Strauss 6 years ago
parent 20946a8b92
commit d171be31ae
  1. 2
      src/http-header-glue.c
  2. 2
      src/mod_proxy.c
  3. 2
      src/response.c

@ -991,7 +991,7 @@ int http_cgi_headers (server *srv, connection *con, http_cgi_opts *opts, http_cg
for (n = 0; n < con->request.headers->used; n++) {
data_string *ds = (data_string *)con->request.headers->data[n];
if (!buffer_is_empty(ds->value) && !buffer_is_empty(ds->key)) {
if (!buffer_string_is_empty(ds->value) && !buffer_is_empty(ds->key)) {
/* Security: Do not emit HTTP_PROXY in environment.
* Some executables use HTTP_PROXY to configure
* outgoing proxy. See also https://httpoxy.org/ */

@ -697,7 +697,7 @@ static int proxy_create_env(server *srv, handler_ctx *hctx) {
ds = (data_string *)con->request.headers->data[i];
if (!buffer_is_empty(ds->value) && !buffer_is_empty(ds->key)) {
if (!buffer_string_is_empty(ds->value) && !buffer_is_empty(ds->key)) {
if (replace_http_host &&
buffer_is_equal_caseless_string(ds->key, CONST_STR_LEN("Host"))) continue;
if (buffer_is_equal_caseless_string(ds->key, CONST_STR_LEN("Connection"))) continue;

@ -70,7 +70,7 @@ int http_response_write_header(server *srv, connection *con) {
ds = (data_string *)con->response.headers->data[i];
if (!buffer_is_empty(ds->value) && !buffer_is_empty(ds->key) &&
if (!buffer_string_is_empty(ds->value) && !buffer_is_empty(ds->key) &&
0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-LIGHTTPD-")) &&
0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-Sendfile"))) {
if (0 == strcasecmp(ds->key->ptr, "Date")) have_date = 1;

Loading…
Cancel
Save