diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:46 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:46 +0100 |
commit | 0f22664a8c9f92c8b7d5dd05772bacf7caecbd52 (patch) | |
tree | c85da4e4968e5ec69d6d154fa032672f45cb3e13 /src/request.c | |
parent | 9fa7c3d770fb8688555b661940e04c3bf6b6d8aa (diff) | |
download | lighttpd-6c5a38c845d111ba26ba9167b500f48dafa30cb5.tar.gz |
Imported Upstream version 1.4.15upstream/1.4.15
Diffstat (limited to 'src/request.c')
-rw-r--r-- | src/request.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/request.c b/src/request.c index eb35332..f76252e 100644 --- a/src/request.c +++ b/src/request.c @@ -85,6 +85,9 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) { /* Host is empty */ if (host_len == 0) return -1; + /* if the hostname ends in a "." strip it */ + if (host->ptr[host_len-1] == '.') host_len -= 1; + /* scan from the right and skip the \0 */ for (i = host_len - 1; i + 1 > 0; i--) { const char c = host->ptr[i]; @@ -741,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))) { |