Project

General

Profile

Actions

Bug #1952

closed

vhosts starting with a number

Added by bangert about 15 years ago. Updated almost 15 years ago.

Status:
Fixed
Priority:
Low
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

Lighty responds with a 404 Bad Request when the virtual host name starts with a number.

diff -ruN lighttpd-1.4.19.orig/src/request.c lighttpd-1.4.19/src/request.c
--- lighttpd-1.4.19.orig/src/request.c  2008-06-19 06:30:05.000000000 +0200
+++ lighttpd-1.4.19/src/request.c       2008-06-19 06:30:33.000000000 +0200
@@ -125,7 +125,7 @@
                                }
                        } else if (i == 0) {
                                /* the first character of the hostname */
-                               if (!light_isalpha(c)) {
+                               if (!light_isalnum(c)) {
                                        return -1;
                                }
                                label_len++;

This bug was originally reported at
http://bugs.gentoo.org/show_bug.cgi?id=228281

Arthur Hagen states on that bug:

If following the RFCs strictly, a host name can not start with a number.

Quoting RFC952:
<name> ::= <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>]

However, after someone (by mistake) assigned 3com the domain name 3com.com some
twenty-odd years ago, the practice has been to allow it even though it's
technically wrong (cf. Mockapetris et al.)

In other words, yeah, this should be fixed despite being "correct".


Related issues 1 (0 open1 closed)

Has duplicate Bug #1148: hostname with initial digit character rejectedFixedActions
Actions #1

Updated by stbuehler almost 15 years ago

  • Status changed from New to Fixed
Actions

Also available in: Atom