diff options
author | Stefan Bühler <stbuehler@web.de> | 2009-06-11 10:18:36 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2009-06-11 10:18:36 +0000 |
commit | 3af67d139238081356a1542f3eeb68ef6fd5fd3d (patch) | |
tree | f4786248a587e017356cedaf197783f3e1fd91a2 | |
parent | 5204fd7e6c8006750ada3d3295972a18b2b5dcd6 (diff) | |
download | lighttpd-git-3af67d139238081356a1542f3eeb68ef6fd5fd3d.tar.gz |
Ignore multiple "If-None-Match" headers (only use first one, fixes #753)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2528 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/request.c | 14 | ||||
-rwxr-xr-x | tests/request.t | 2 |
3 files changed, 4 insertions, 13 deletions
@@ -52,6 +52,7 @@ NEWS * Add ssi.content-type option (default text/html, fixes #615) * Add support for "real" entropy from /dev/[u]random (fixes #1977) * Adding support for additional chars in LDAP usernames (fixes #1941) + * Ignore multiple "If-None-Match" headers (only use first one, fixes #753) - 1.4.22 - 2009-03-07 * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533) diff --git a/src/request.c b/src/request.c index 9a2c7211..c5762e40 100644 --- a/src/request.c +++ b/src/request.c @@ -956,18 +956,8 @@ int http_request_parse(server *srv, connection *con) { if (!con->request.http_if_none_match) { con->request.http_if_none_match = ds->value->ptr; } else { - con->http_status = 400; - con->keep_alive = 0; - - if (srv->srvconf.log_request_header_on_error) { - log_error_write(srv, __FILE__, __LINE__, "s", - "duplicate If-None-Match-header -> 400"); - log_error_write(srv, __FILE__, __LINE__, "Sb", - "request-header:\n", - con->request.request); - } - array_insert_unique(con->request.headers, (data_unset *)ds); - return 0; + ds->free((data_unset*) ds); + ds = NULL; } } else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Range")))) { if (!con->request.http_range) { diff --git a/tests/request.t b/tests/request.t index ab4f2d2c..0a35f571 100755 --- a/tests/request.t +++ b/tests/request.t @@ -280,7 +280,7 @@ If-None-Match: 5 If-None-Match: 4 EOF ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; ok($tf->handle_http($t) == 0, 'Duplicate If-None-Match headers'); $t->{REQUEST} = ( <<EOF |