https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412007-08-29T23:44:51Zlighty labsLighttpd - Bug #1330: 400 Bad Request when using IP's numeric value ("ip2long()")https://redmine.lighttpd.net/issues/1330?journal_id=32832007-08-29T23:44:51ZAnonymous
<ul></ul><p>Errr, this (#)&$ing wiki screwed up my formatting...I should've previewed first! Here are the relevant pieces:</p>
<p>(or with a calculator, octet1*256^3^ + octet2*256^2^ + octet3*256 + octet4)</p>
<p>64.233.167.99 (64 * (256^3^)) + (233 * (256^2^)) + (167 * 256) + 99 1089054563</p>
<p>-- Ben <ben_is_a</p> Lighttpd - Bug #1330: 400 Bad Request when using IP's numeric value ("ip2long()")https://redmine.lighttpd.net/issues/1330?journal_id=95572016-05-02T23:10:48Zcarpii
<ul></ul><p>Not a valid bug (maybe it was at the time)</p>
<p>The octet address is decoded to an IP before the connection is even made to lighttpd <br />The HTTP Host header still specifies the octet hostname, but lighty treats this as an abritrary string anyway..</p>
<p>For my test IP of 192.168.1.79....</p>
<p>$HTTP["host"] == "3232235855" {<br /> url.redirect = ( "^/(.*)" => "http://google.com" )<br />}</p>
<p>$ wget <a class="external" href="http://3232235855">http://3232235855</a></p>
<p>--2016-05-03 00:06:09-- <a class="external" href="http://3232235855/">http://3232235855/</a><br />Resolving 3232235855... 192.168.1.79<br />Connecting to 3232235855|192.168.1.79|:80... connected.<br />HTTP request sent, awaiting response... 301 Moved Permanently<br />Location: <a class="external" href="http://google.com">http://google.com</a> [following]</p> Lighttpd - Bug #1330: 400 Bad Request when using IP's numeric value ("ip2long()")https://redmine.lighttpd.net/issues/1330?journal_id=95582016-05-04T20:22:59Zgstrauss
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/9558/diff?detail_id=7623">diff</a>)</li></ul><p>There are a number of open issues related to the feature request of lighttpd parsing various formats of numerical strings in the Host header into an IP address that is then used for condition matching. request.c:request_check_hostname() is the place where many of these are rejected. I was thinking that a new config switch (or switches) might disable the strict checks here, and/or parse various numerical formats into IP strings.</p> Lighttpd - Bug #1330: 400 Bad Request when using IP's numeric value ("ip2long()")https://redmine.lighttpd.net/issues/1330?journal_id=96422016-05-18T10:55:37Zgstrauss
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Patch Pending</i></li><li><strong>Assignee</strong> deleted (<del><i>jan</i></del>)</li><li><strong>Target version</strong> set to <i>1.4.40</i></li></ul> Lighttpd - Bug #1330: 400 Bad Request when using IP's numeric value ("ip2long()")https://redmine.lighttpd.net/issues/1330?journal_id=96652016-05-23T05:40:06Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[config] opts for http header parsing strictness (fixes #551, fixes #1086, fixes #1184, fixes #21..." href="https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/b47494d4cda6dc1a152f9033e4617897842c2f50">b47494d4cda6dc1a152f9033e4617897842c2f50</a>.</p>