Applied HTTP.pm patch from Andy Grundman <andy@hybridized.org>. Fixed debug log on...
Christian Hansen [Tue, 19 Apr 2005 17:21:47 +0000 (17:21 +0000)]
lib/Catalyst/Engine.pm
lib/Catalyst/Engine/HTTP.pm

index 257a8cd..d1716ef 100644 (file)
@@ -463,7 +463,8 @@ sub prepare {
         $t->setColWidth( 'Key',   37, 1 );
         $t->setColWidth( 'Value', 36, 1 );
         for my $key ( keys %{ $c->req->params } ) {
-            my $value = $c->req->params->{$key} || '';
+            my $param = $c->req->params->{$key};
+            my $value = defined($param) ? $param : '';
             $t->addRow( $key, $value );
         }
         $c->log->debug( 'Parameters are', $t->draw );
index 0d73456..598670d 100644 (file)
@@ -67,10 +67,12 @@ sub run {
             $request->uri->scheme('http');    # Force URI::http
             $request->uri->host( $request->header('Host') || $base->host );
             $request->uri->port( $base->port );
+            
+            my $hostname = gethostbyaddr( $connection->peeraddr, AF_INET );
 
             my $http = Catalyst::Engine::Test::HTTP->new(
                 address  => $connection->peerhost,
-                hostname => gethostbyaddr( $connection->peeraddr, AF_INET ),
+                hostname => $hostname || $connection->peerhost,
                 request  => $request,
                 response => HTTP::Response->new
             );