https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412011-08-16T12:36:53Zlighty labsLighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=75582011-08-16T12:36:53Zstbuehler
<ul><li><strong>Target version</strong> set to <i>1.4.30</i></li></ul><p>the bug is in the *cgi modules when they try to remove the port from the http_host var.<br />i'm not sure whether SERVER_NAME should wrap ipv6 addresses in [...]</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=75592011-08-16T12:41:00Zspaam
<ul></ul><p>How do apache and nginx do it ?</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=75602011-08-16T12:52:26Zsimoncpu
<ul></ul><p>I don't have a working Apache setup right now, but it seems that they wrap IPv6 addresses in brackets too:</p>
<p>[[<a class="external" href="https://issues.apache.org/bugzilla/show_bug.cgi?id=26005">https://issues.apache.org/bugzilla/show_bug.cgi?id=26005</a>]]</p>
<p>nginx, however, uses my machine's hostname if I don't set a server_name statement in the configuration.</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=76792011-11-30T21:47:40Zstbuehler
<ul><li><strong>Target version</strong> changed from <i>1.4.30</i> to <i>1.4.x</i></li></ul> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=77972012-03-16T12:01:44Zsimoncpu
<ul><li><strong>File</strong> <a href="/attachments/1343">mod_fastcgi.c.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1343/mod_fastcgi.c.patch">mod_fastcgi.c.patch</a> added</li><li><strong>File</strong> <a href="/attachments/1344">mod_cgi.c.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1344/mod_cgi.c.patch">mod_cgi.c.patch</a> added</li></ul><p>Attached are patches for mod_cgi.c and mod_fastcgi.c.</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=77982012-03-16T12:08:51Zstbuehler
<ul></ul><ul>
<li>you can cat the patches into one file next time :)</li>
<li>i think these patches fail when you use dns names, like "Host: lighttpd.net:443" - lighttpd.net has an IPv6 address, so the socket type could be IPv6, but there is no [...]:443. i'd say if the first (non white-space?) char is '[' then search for ']:', otherwise for ':'. (this also means we can test it easier, as this doesn't depend on the socket type, just on the Host: header)</li>
<li>it would be very nice if you could add some test-cases for this, probably in the mod_fastcgi part.</li>
</ul> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=77992012-03-16T13:15:58Zsimoncpu
<ul><li><strong>File</strong> <a href="/attachments/1345">patches</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1345/patches">patches</a> added</li></ul><p><strong>(WARNING: This patch doesn't work if lighttpd uses the standard port 80. I'm still writing a correct fix. Thanks.)</strong></p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=78022012-03-22T12:24:17Zsimoncpu
<ul><li><strong>File</strong> <a href="/attachments/1348">server_name.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1348/server_name.patch">server_name.patch</a> added</li></ul> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=78032012-03-22T12:34:35Zsimoncpu
<ul><li><strong>File</strong> <a href="/attachments/1349">server_name.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1349/server_name.patch">server_name.patch</a> added</li></ul> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=78042012-03-22T12:58:54Zsimoncpu
<ul><li><strong>File</strong> <a href="/attachments/1350">server_name.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1350/server_name.patch">server_name.patch</a> added</li></ul><p>lighttpd patch, take 5 hehehe:</p>
<p>This has been tested with:<br />- 192.0.2.1<br />- 192.0.2.1:8080<br />- [2001:DB8::1]<br />- [2001:DB8::1]:8080<br />- example.org (both IPv4 and IPv6)<br />- example.org:8080 (both IPv4 and IPv6)<br />- with and without --disable-ipv6</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=78682012-04-19T15:05:10Zstbuehler
<ul><li><strong>Status</strong> changed from <i>New</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 r2834.</p> Lighttpd - Bug #2333: $_SERVER['SERVER_NAME'] returns an incorrect value when using IPv6https://redmine.lighttpd.net/issues/2333?journal_id=78722012-04-19T15:11:11Zstbuehler
<ul><li><strong>Target version</strong> changed from <i>1.4.x</i> to <i>1.4.31</i></li></ul>