Fix dump bug in C::Log
Christian Hansen [Sat, 26 Mar 2005 01:52:24 +0000 (01:52 +0000)]
lib/Catalyst/Engine.pm
lib/Catalyst/Engine/HTTP/Daemon.pm
lib/Catalyst/Log.pm

index 4259d7c..5294921 100644 (file)
@@ -482,8 +482,8 @@ sub prepare {
     }
     $c->prepare_request($r);
     $c->prepare_path;
-    $c->prepare_cookies;
     $c->prepare_headers;
+    $c->prepare_cookies;
     $c->prepare_connection;
     my $method   = $c->req->method   || '';
     my $path     = $c->req->path     || '';
index 6d90e39..95fa597 100644 (file)
@@ -54,13 +54,16 @@ sub run {
         die("Failed to create daemon: $!\n");
     }
 
-    printf( "You can connect to your server at %s\n", $daemon->url );
+    my $base = URI->new( $daemon->url )->canonical;
+
+    printf( "You can connect to your server at %s\n", $base );
 
     while ( my $connection = $daemon->accept ) {
 
         while ( my $request = $connection->get_request ) {
 
             $request->uri->scheme('http');    # Force URI::http
+            $request->uri->host( $base->host );
 
             my $lwp = Catalyst::Engine::Test::LWP->new(
                 request  => $request,
index 6bb131a..833087b 100644 (file)
@@ -86,7 +86,7 @@ Logs a Data::Dumper of reference.
 
 =cut
 
-sub dump { shift->_format( 'dump', Dumper( $_[1] ) ) }
+sub dump { shift->_format( 'dump', Dumper( $_[0] ) ) }
 
 =back