A failing reverse lookup doesn't imply it's a local address
Florian Ragwitz [Tue, 12 Apr 2011 00:05:59 +0000 (02:05 +0200)]
lib/Catalyst/Engine/HTTP.pm
lib/Catalyst/Request.pm

index 97cd8d6..1ba4cf2 100644 (file)
@@ -546,7 +546,7 @@ sub _socket_data {
     my %hostname_cache;
     sub _gethostbyaddr {
         my $ip = shift;
-        $hostname_cache{$ip} ||= gethostbyaddr( $ip, AF_INET ) || 'localhost';
+        $hostname_cache{$ip} ||= gethostbyaddr( $ip, AF_INET ) || $ip;
     }
 }
 
index ab5c0da..921eab4 100644 (file)
@@ -120,7 +120,7 @@ has hostname => (
   lazy      => 1,
   default   => sub {
     my ($self) = @_;
-    gethostbyaddr( inet_aton( $self->address ), AF_INET ) || 'localhost'
+    gethostbyaddr( inet_aton( $self->address ), AF_INET ) || $self->address
   },
 );