diff -rc ../apache_1.3.9/src/include/httpd.h ./src/include/httpd.h *** ../apache_1.3.9/src/include/httpd.h Mon Aug 16 10:57:53 1999 --- ./src/include/httpd.h Fri Nov 5 12:40:35 1999 *************** *** 921,926 **** --- 921,930 ---- int limit_req_line; /* limit on size of the HTTP request line */ int limit_req_fieldsize; /* limit on size of any request header field */ int limit_req_fields; /* limit on number of request header fields */ + #ifdef SERVERNAME_CASE_SENSITIVE + + int is_case_sensitive; /* true if ServerNameCaseSensitive */ + #endif /* SERVERNAME_CASE_SENSITIVE */ }; /* These are more like real hosts than virtual hosts */ diff -rc ../apache_1.3.9/src/main/http_core.c ./src/main/http_core.c *** ../apache_1.3.9/src/main/http_core.c Mon Aug 9 00:29:29 1999 --- ./src/main/http_core.c Fri Nov 5 14:12:01 1999 *************** *** 1832,1837 **** --- 1832,1859 ---- return NULL; } + #ifdef SERVERNAME_CASE_SENSITIVE + static const char *set_servername_string_slot(cmd_parms *cmd, void *dummy, + char *arg) + { + /* Set the server name, either case sensitive or not */ + + const char *err = ap_check_cmd_context(cmd, + NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + if (err != NULL) { + return err; + } + + cmd->server->is_case_sensitive = !strcasecmp (cmd->cmd->name, + "ServerNameCaseSensitive"); + cmd->server->server_hostname = arg; + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, cmd->server, + "%s%s", cmd->server->server_hostname, + cmd->server->is_case_sensitive? " is case sensitive" : " is not case sensitive"); + return NULL; + } + + #endif /* SERVERNAME_CASE_SENSITIVE */ static const char *server_type(cmd_parms *cmd, void *dummy, char *arg) { const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); *************** *** 2804,2810 **** --- 2826,2839 ---- { "ServerAdmin", set_server_string_slot, (void *)XtOffsetOf (server_rec, server_admin), RSRC_CONF, TAKE1, "The email address of the server administrator" }, + #ifndef SERVERNAME_CASE_SENSITIVE { "ServerName", set_server_string_slot, + #else /* SERVERNAME_CASE_SENSITIVE */ + { "ServerNameCaseSensitive", set_servername_string_slot, + (void *)XtOffsetOf (server_rec, server_hostname), RSRC_CONF, TAKE1, + "The case sensitive hostname of the server" }, + { "ServerName", set_servername_string_slot, + #endif /* SERVERNAME_CASE_SENSITIVE */ (void *)XtOffsetOf (server_rec, server_hostname), RSRC_CONF, TAKE1, "The hostname of the server" }, { "ServerSignature", set_signature_flag, NULL, OR_ALL, TAKE1, diff -rc ../apache_1.3.9/src/main/http_vhost.c ./src/main/http_vhost.c *** ../apache_1.3.9/src/main/http_vhost.c Fri Jan 1 11:04:51 1999 --- ./src/main/http_vhost.c Fri Nov 5 14:12:01 1999 *************** *** 682,691 **** --- 682,702 ---- int i; array_header *names; + #ifndef SERVERNAME_CASE_SENSITIVE /* match ServerName */ if (!strcasecmp(host, s->server_hostname)) { return 1; } + #else /* SERVERNAME_CASE_SENSITIVE */ + /* match ServerName if possible */ + if (s->is_case_sensitive) { + if (!strcmp(host, s->server_hostname)) + return 1; + } else { + if (!strcasecmp(host, s->server_hostname)) + return 1; + } + #endif /* SERVERNAME_CASE_SENSITIVE */ /* search all the aliases from ServerAlias directive */ names = s->names;