Browse Source

strip trailing white-spaces in HTTP-request headers

before we parse them (fixes #1098)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1727 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.14
Jan Kneschke 15 years ago
parent
commit
76e55e958c
  1. 7
      src/request.c

7
src/request.c

@ -744,6 +744,13 @@ int http_request_parse(server *srv, connection *con) {
s_len = cur - value;
/* strip trailing white-spaces */
for (; s_len > 0 &&
(value[s_len - 1] == ' ' ||
value[s_len - 1] == '\t'); s_len--);
value[s_len] = '\0';
if (s_len > 0) {
int cmp = 0;
if (NULL == (ds = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {

Loading…
Cancel
Save