From f24fa316954f0f9ae3a679143c577023acae58fb Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 23 Jun 2002 08:10:49 +0000 Subject: [PATCH] Convert the hostname to all-lowercase in fix_hostname() so that the implementation matches the comments. (Note: The current virtual hosting code does case-insensitive host matching, so this fix is useful mostly to help ensure that custom modules and any future vhosting code don't get tripped up by case-sensitivity issues.) Submitted by: Perry Harrington Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95866 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ server/vhost.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index d1665b08af..8675e7beec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.40 + *) Normalize the hostname value in the request_rec to all-lowercase + [Perry Harrington ] + *) Fix Win32 cgi 500 errors when QUERY_ARGS or other strings include extended characters (non US-ASCII) in non-utf8 format. This brings Win32 back into CGI/1.1 compliance, and leaves charset decoding up diff --git a/server/vhost.c b/server/vhost.c index 07d7e2e0f4..1ca68733d9 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -785,6 +785,9 @@ static void fix_hostname(request_rec *r) else if (*dst == '/' || *dst == '\\') { goto bad; } + else if (apr_isalpha(*dst)) { + *dst = apr_tolower(*dst); + } } /* strip trailing gubbins */ if (dst > host && dst[-1] == '.') { -- 2.40.0