*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 7 Jul 2005 00:20:00 +0000 (00:20 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 7 Jul 2005 00:20:00 +0000 (00:20 +0000)
tests/js-test/js/httpd/httpd.js

index 01fa1f2..ecd3bba 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: httpd.js,v 1.17 2005/07/07 00:11:30 mmondor Exp $ */
+/* $Id: httpd.js,v 1.18 2005/07/07 00:20:00 mmondor Exp $ */
 
 /*
  * Copyright (c) 2005, Matthew Mondor
@@ -75,7 +75,7 @@ eval(file_read('root.js'));           /* Root object for virtual chroot(2) */
  * Server identification
  */
 SERVER_VERSION                 = 'mmondor_js_httpd/0.0.1 (NetBSD)';
-SERVER_CVSID   = '$Id: httpd.js,v 1.17 2005/07/07 00:11:30 mmondor Exp $';
+SERVER_CVSID   = '$Id: httpd.js,v 1.18 2005/07/07 00:20:00 mmondor Exp $';
 
 
 
@@ -105,6 +105,7 @@ function VHost(o)
         */
        if (o.name == undefined || o.root == undefined)
                throw ('name and root properties missing from vhost');
+       o.name = o.name.toLowerCase();
        this.name = o.name;
 
        if (o.scripts != undefined && o.scripts == true)
@@ -130,6 +131,7 @@ function VHost(o)
 
        if (o.aliases != undefined) {
                for (i in o.aliases) {
+                       o.aliases[i] = o.aliases[i].toLowerCase();
                        if (vhosts_table[o.aliases[i]] != undefined)
                                throw ('Conflicting vhost alias: ' +
                                    o.aliases[i]);
@@ -594,7 +596,7 @@ FD.prototype.parseRequest = function()
         */
        if (vhost == '' || vhosts_table[vhost] == undefined)
                vhost = options.default_vhost;
-       this.http_vhost = vhosts_table[vhost];
+       this.http_vhost = vhosts_table[vhost.toLowerCase()];
 
        /*
         * Fill in associative array with any GET-style supplied
@@ -970,7 +972,8 @@ function main() {
                exit();
        }
        if (vhosts_table[options.default_vhost] != undefined)
-               default_vhost = vhosts_table[options.default_vhost];
+               default_vhost =
+                   vhosts_table[options.default_vhost.toLowerCase()];
        else {
                err.put('Default vhost ' + options.default_vhost +
                    " unkonwn, exiting\n");