Another 2.4.25 regression reported from a Fedora user is that 
underscores in hostnames are rejected by default now.  I couldn't see a 
specific discussion of this, was it deliberate?

Following breadcrumbs...

https://tools.ietf.org/html/rfc7230#section-5.4
     Host = uri-host [ ":" port ] ; Section 2.7.1

https://tools.ietf.org/html/rfc7230#section-2.7
   uri-host = <host, see [RFC3986], Section 3.2.2>

https://tools.ietf.org/html/rfc3986#section-3.2.2
      host        = IP-literal / IPv4address / reg-name
...
      reg-name    = *( unreserved / pct-encoded / sub-delims )

https://tools.ietf.org/html/rfc3986#section-2.3
      unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

>From google I can see that _ in hostnames has various issues, so I'm not 
sure what is right here.  It's simple enough to relax the check, seems 
unlikely allowing ~ is a good idea.

Index: server/vhost.c
===================================================================
--- server/vhost.c      (revision 1781359)
+++ server/vhost.c      (working copy)
@@ -757,7 +757,10 @@
     int is_dotted_decimal = 1, leading_zeroes = 0, dots = 0;
 
     for (ch = host; *ch; ch++) {
-        if (apr_isalpha(*ch) || *ch == '-') {
+        /* This should allow any character in 'uri-host' per RFC
+         * 7320s5.4, which is 'host' by RFC 3986, which matches any
+         * 'unreserved' character. */
+        if (apr_isalpha(*ch) || *ch == '-' || *ch == '_') {
             is_dotted_decimal = 0;
         }
         else if (ch[0] == '.') {

Reply via email to