Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2281 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Stefan Bühler 15 years ago
parent ba715e1c8f
commit ec61ba0559

@ -51,6 +51,7 @@ NEWS
* print helpful error message on conditionals in global block (#1550)
* decode url before matching in mod_rewrite (#1720)
* fixed conditional patching of ldap filter (#1564)
* Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
- 1.4.19 - 2008-03-10

@ -64,10 +64,10 @@ int http_response_write_header(server *srv, connection *con) {
ds = (data_string *)con->response.headers->data[i];
if (ds->value->used && ds->key->used &&
0 != strncmp(ds->key->ptr, "X-LIGHTTPD-", sizeof("X-LIGHTTPD-") - 1) &&
0 != strncmp(ds->key->ptr, "X-Sendfile", sizeof("X-Sendfile") - 1)) {
if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Date"))) have_date = 1;
if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Server"))) have_server = 1;
0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-LIGHTTPD-")) &&
0 != strcasecmp(ds->key->ptr, "X-Sendfile")) {
if (0 == strcasecmp(ds->key->ptr, "Date")) have_date = 1;
if (0 == strcasecmp(ds->key->ptr, "Server")) have_server = 1;
buffer_append_string_len(b, CONST_STR_LEN("\r\n"));
buffer_append_string_buffer(b, ds->key);

Loading…
Cancel
Save