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-c4023f1b3aa9svn/tags/lighttpd-1.4.14
parent
ad4af113a6
commit
4a609547a0
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue