https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412010-09-16T00:32:53Zlighty labsLighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72402010-09-16T00:32:53Znitrox
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Invalid</i></li></ul><p>This is our bugtracker, not the support forum.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72422010-09-16T10:02:21Zicy
<ul></ul><p>As an explanation: _ is not allowed in hostnames.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72432010-09-16T23:40:38ZOlaf-van-der-Spek
<ul></ul><p>icy wrote:</p>
<blockquote>
<p>As an explanation: _ is not allowed in hostnames.</p>
</blockquote>
<p>Says who?</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72452010-09-16T23:51:32Znitrox
<ul></ul><p>The RFC says so (you´ll find the correct one yourself). Don´t mix valid hostnames with allowed DNS names.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72462010-09-17T08:32:23Zluivm
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>The RFC is 1123:<br /><a class="external" href="http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names">http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names</a></p>
<p>Here the part we are interested on :<br />The Internet standards (Request for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted.</p>
<p>Thank you to everyone.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72472010-09-17T10:58:40ZOlaf-van-der-Spek
<ul></ul><p>nitrox wrote:</p>
<blockquote>
<p>The RFC says so (you´ll find the correct one yourself). Don´t mix valid hostnames with allowed DNS names.</p>
</blockquote>
<p>I can't find the requirement in RFC2616 to validate the host name.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72482010-09-17T11:11:36Zicy
<ul></ul><a name="RFC2616"></a>
<h3 >RFC2616<a href="#RFC2616" class="wiki-anchor">¶</a></h3>
<pre>
14.23 Host
Host = "Host" ":" host [ ":" port ] ;
3.2.1 General Syntax
RFC 2396 [42] (which replaces RFCs
1738 [4] and RFC 1808 [11]). This specification adopts the
definitions of "URI-reference", "absoluteURI", "relativeURI", "port",
"host","abs_path", "rel_path", and "authority" from that
specification.
</pre>
<a name="RFC2396"></a>
<h3 >RFC2396<a href="#RFC2396" class="wiki-anchor">¶</a></h3>
<pre>
3.2.2. Server-based Naming Authority
host = hostname | IPv4address
hostname = *( domainlabel "." ) toplabel [ "." ]
domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
toplabel = alpha | alpha *( alphanum | "-" ) alphanum
</pre>
<p>This has been discussed many times already.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72632010-09-21T12:14:15ZOlaf-van-der-Spek
<ul></ul><p>icy wrote:</p>
<blockquote>
<p>This has been discussed many times already.</p>
</blockquote>
<p>AFAIK Lighttpd is a web server, not a protocol validator. ;)<br />Why does Lighttpd need to validate the host name against RFC2396?</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72642010-09-21T12:23:04Zicy
<ul></ul><p>Because RFC2616 which is the HTTP/1.1 RFC says so, like I quoted above.</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72652010-09-21T12:30:24Zluivm
<ul></ul><p>I agree with Olaf, lighttpd is a web server and is not a protocol validor.<br />Apache2 for example don't validate the rfc</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72662010-09-21T12:35:09Zicy
<ul></ul><p>Can you guys give one good reason why there would be a need to allow underscores in hostnames and why you can't just use dashes instead?</p> Lighttpd - Bug #2258: Bad Requesthttps://redmine.lighttpd.net/issues/2258?journal_id=72672010-09-21T16:43:18ZOlaf-van-der-Spek
<ul></ul><p>icy wrote:</p>
<blockquote>
<p>Because RFC2616 which is the HTTP/1.1 RFC says so, like I quoted above.</p>
</blockquote>
<p>Your quotes don't say that 400 should be returned if the request does not match the RFC.</p>
<blockquote>
<p>Can you guys give one good reason why there would be a need to allow underscores in hostnames and why you can't just use dashes instead?</p>
</blockquote>
<p>The underscore might've been used for ages, so changing it might not be an option due to existing links.</p>