Module Name:    src
Committed By:   mrg
Date:           Sun Feb  9 12:32:32 UTC 2014

Modified Files:
        src/libexec/httpd: bozohttpd.8 bozohttpd.c

Log Message:
- bump man page date
- strip :80 off virtual host names as they're the default


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.48 -r1.49 src/libexec/httpd/bozohttpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.45 src/libexec/httpd/bozohttpd.8:1.46
--- src/libexec/httpd/bozohttpd.8:1.45	Sun Feb  9 01:46:10 2014
+++ src/libexec/httpd/bozohttpd.8	Sun Feb  9 12:32:32 2014
@@ -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

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.48 src/libexec/httpd/bozohttpd.c:1.49
--- src/libexec/httpd/bozohttpd.c:1.48	Sun Feb  9 01:46:10 2014
+++ src/libexec/httpd/bozohttpd.c	Sun Feb  9 12:32:32 2014
@@ -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'",

Reply via email to