diff options
| author | mrg <mrg@NetBSD.org> | 2014-02-09 12:32:32 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2014-02-09 12:32:32 +0000 |
| commit | ce5daa881362f610e41a0cd75e47dd6756eff58f (patch) | |
| tree | 589f1c9f0a530ca043c7da4ac6bc83b49c0d3ffb /libexec | |
| parent | 1e7390e4004c5f309622d037db9ab268e5766e50 (diff) | |
- bump man page date
- strip :80 off virtual host names as they're the default
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/httpd/bozohttpd.8 | 4 | ||||
| -rw-r--r-- | libexec/httpd/bozohttpd.c | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/libexec/httpd/bozohttpd.8 b/libexec/httpd/bozohttpd.8 index 8753914da99..b11102a5bc6 100644 --- a/libexec/httpd/bozohttpd.8 +++ b/libexec/httpd/bozohttpd.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: bozohttpd.8,v 1.45 2014/02/09 01:46:10 mrg Exp $ +.\" $NetBSD: bozohttpd.8,v 1.46 2014/02/09 12:32:32 mrg Exp $ .\" .\" $eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $ .\" @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2014 +.Dd February 9, 2014 .Dt HTTPD 8 .Os .Sh NAME diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c index 88f310cbe9c..ef0934cfa5d 100644 --- a/libexec/httpd/bozohttpd.c +++ b/libexec/httpd/bozohttpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.48 2014/02/09 01:46:10 mrg Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.49 2014/02/09 12:32:32 mrg Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ @@ -1058,12 +1058,20 @@ check_virtual(bozo_httpreq_t *request) goto use_slashdir; /* - * ok, we have a virtual host, use scandir(3) to find a case + * canonicalise hr_host - that is, remove any :80. + */ + len = strlen(request->hr_host); + if (len > 3 && strcmp(request->hr_host + len - 3, ":80") == 0) { + request->hr_host[len - 3] = '\0'; + len = strlen(request->hr_host); + } + + /* + * ok, we have a virtual host, use opendir(3) to find a case * insensitive match for the virtual host we are asked for. * note that if the virtual host is the same as the master, * we don't need to do anything special. */ - len = strlen(request->hr_host); debug((httpd, DEBUG_OBESE, "check_virtual: checking host `%s' under httpd->virtbase `%s' " "for file `%s'", |
