From: Tomas Doran Date: Sun, 28 Mar 2010 16:43:37 +0000 (+0000) Subject: Back out 13063. This changes the CGI environment we construct to just be plain wrong... X-Git-Tag: 5.80022~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=99d93ba8704ef47d3477c7fbf1bd05fc24fce32e Back out 13063. This changes the CGI environment we construct to just be plain wrong, SERVER_NAME is meant to be a name after all. I have a feeling that all of this crap could be simplified, but I don't want to spend a lot of tuits changing it (and possibly breaking things for people with non-obvious behaviour changes like this one) - when those tuits could be spent on Plack stuff so that all this code dies anyway (and we do a major release so breakage can be more reasonable expected / extensively tested for). This is all possibly being _too_ paranoid here, but given the original commit didn't know what was happening / what changed _at all_, I think that's fair.. --- diff --git a/Changes b/Changes index 4db5cf4..e05dd8b 100644 --- a/Changes +++ b/Changes @@ -11,10 +11,6 @@ in parameter filtering (for example). - $c->model/view/controller have become a lot faster for non-regexp names by using direct hash lookup instead of looping. - - Now reports the used server address as an IP string rather than a - looked up hostname (because nothing really cares and hostname - lookups, even on local interfaces, can be slow on dev machines with - hosed DNS setups) Bug fixed: - DispatchType::Index's uri_for_action only returns for actions registered diff --git a/lib/Catalyst/Engine/HTTP.pm b/lib/Catalyst/Engine/HTTP.pm index 6b0bc12..7f01795 100644 --- a/lib/Catalyst/Engine/HTTP.pm +++ b/lib/Catalyst/Engine/HTTP.pm @@ -534,7 +534,8 @@ sub _socket_data { peeraddr => $iaddr ? ( inet_ntoa($iaddr) || '127.0.0.1' ) : '127.0.0.1', - localname => inet_ntoa($localiaddr) || '127.0.0.1', + localname => gethostbyaddr( $localiaddr, AF_INET ) || 'localhost', + localaddr => inet_ntoa($localiaddr) || '127.0.0.1', }; return $data;