X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=40d4281bc9c8761f0cae3d0e541f23ca5574edc1;hb=8264c14575653b5cb391953eda443eed19a7c31d;hp=ba408f9b56cc517f862b6968400353bc73df59ce;hpb=4f5ebacdba8bc446f80d0e8999d117d80f9d2c98;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ba408f9..40d4281 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -7,6 +7,7 @@ use Data::Dumper; use HTML::Entities; use HTTP::Body; use HTTP::Headers; +use URI::QueryParam; # input position and length __PACKAGE__->mk_accessors(qw/read_position read_length/); @@ -43,8 +44,16 @@ Finalize body. Prints the response output. sub finalize_body { my ( $self, $c ) = @_; - - $self->write( $c, $c->response->output ); + if ( ref $c->response->body && $c->response->body->can('read') ) { + while ( !$c->response->body->eof() ) { + $c->response->body->read( my $buffer, $CHUNKSIZE ); + $self->write( $c, $buffer ); + } + $c->response->body->close(); + } + else { + $self->write( $c, $c->response->body ); + } } =item $self->finalize_cookies($c) @@ -108,15 +117,28 @@ sub finalize_error { my $req = encode_entities Dumper $c->req; my $res = encode_entities Dumper $c->res; my $stash = encode_entities Dumper $c->stash; - $infos = <<""; -
-Request
-
$req
-Response
-
$res
-Stash
-
$stash
+ my @infos; + my $i = 0; + warn "BAAR"; + for my $dump ( $c->dump_these ) { + warn "FOOO"; + my $name = $dump->[0]; + my $value = encode_entities( Dumper $dump->[1] ); + push @infos, sprintf <<"EOF", $name, $value; +
+ + %s + +
+
+
+
%s
+
+EOF + $i++; + } + $infos = join "\n", @infos; } else { $title = $name; @@ -139,6 +161,18 @@ sub finalize_error { $title +