r1435@h2o: darix | 2006-11-10 18:25:42 +0100

"www.example.com." is equivalent to "www.example.com".
 The trailing dot just tells the resolver to script the searchlist.
 
 If we want to match the hostname for conditionals/mod*vhost,
 we need to strip it.
 
 * src/request.c: (request_check_hostname) Decrement host_len to skip
   the trailing dot.
 


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1406 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.14
Marcus Rückert 2006-11-10 17:37:19 +00:00
parent ad4af113a6
commit 4a609547a0
1 changed files with 3 additions and 0 deletions

View File

@ -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];