Changeset 1406

Show
Ignore:
Timestamp:
11/10/2006 05:37:19 PM (2 years ago)
Author:
darix
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lighttpd-1.4.x/src/request.c

    r1371 r1406  
    8585        /* Host is empty */ 
    8686        if (host_len == 0) return -1; 
     87 
     88        /* if the hostname ends in a "." strip it */ 
     89        if (host->ptr[host_len-1] == '.') host_len -= 1; 
    8790 
    8891        /* scan from the right and skip the \0 */