From 0483837c3e9753a24146ff4642b85a4d0567ad58 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 25 Jun 2018 13:18:24 +0000 Subject: [PATCH] Re-allow '_' (underscore) in hostnames. '_' was not permitted in hostnames since 2.4.25's "HTTP Strict" changes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1834318 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ server/vhost.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 611e69a9a4..6e9f075c93 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + + *) core: Re-allow '_' (underscore) in hostnames. + [Eric Covener] + *) ru, zh-cn and zh-tw translations of errordocs have been added. Contributed by Alexander Gaganashvili and CodeingBoy diff --git a/server/vhost.c b/server/vhost.c index dc9689d2c0..45f521269e 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -760,7 +760,7 @@ static apr_status_t strict_hostname_check(request_rec *r, char *host) int is_dotted_decimal = 1, leading_zeroes = 0, dots = 0; for (ch = host; *ch; ch++) { - if (apr_isalpha(*ch) || *ch == '-') { + if (apr_isalpha(*ch) || *ch == '-' || *ch == '_') { is_dotted_decimal = 0; } else if (ch[0] == '.') { -- 2.40.0