fixed invalid chars in header values (fixes #1286)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1928 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.17
Jan Kneschke 2007-08-17 21:49:13 +00:00
parent 5f518191bd
commit 8f8e23f636
1 changed files with 11 additions and 0 deletions

View File

@ -1011,6 +1011,17 @@ int http_request_parse(server *srv, connection *con) {
/* strip leading WS */
if (value == cur) value = cur+1;
default:
if (*cur >= 0 && *cur < 32) {
if (srv->srvconf.log_request_header_on_error) {
log_error_write(srv, __FILE__, __LINE__, "sds",
"invalid char in header", (int)*cur, "-> 400");
}
con->http_status = 400;
con->keep_alive = 0;
return 0;
}
break;
}
}