X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=44176bc2d941128224c09e07157ac7a464310aea;hp=22309080dd0066a22271ec02307a59dc491256a4;hb=2666dd3ba45edb0fa31508f67d94fe80072f94f6;hpb=4d98d16dff4df87a96054967d73cf3c7a4801344 diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 2230908..44176bc 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -30,13 +30,11 @@ See L. =head1 METHODS -=over 4 - -=item $self->finalize_output +=head2 $self->finalize_output , see finalize_body -=item $self->finalize_body($c) +=head2 $self->finalize_body($c) Finalize body. Prints the response output. @@ -47,7 +45,7 @@ sub finalize_body { 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 ); + last unless $self->write( $c, $buffer ); } $c->response->body->close(); } @@ -56,7 +54,7 @@ sub finalize_body { } } -=item $self->finalize_cookies($c) +=head2 $self->finalize_cookies($c) =cut @@ -78,19 +76,19 @@ sub finalize_cookies { push @cookies, $cookie->as_string; } - if (@cookies) { - $c->res->headers->push_header( 'Set-Cookie' => join ',', @cookies ); + for my $cookie (@cookies) { + $c->res->headers->push_header( 'Set-Cookie' => $cookie ); } } -=item $self->finalize_error($c) +=head2 $self->finalize_error($c) =cut sub finalize_error { my ( $self, $c ) = @_; - $c->res->headers->content_type('text/html'); + $c->res->content_type('text/html; charset=utf-8'); my $name = $c->config->{name} || 'Catalyst Application'; my ( $title, $error, $infos ); @@ -98,11 +96,15 @@ sub finalize_error { # For pretty dumps local $Data::Dumper::Terse = 1; - $error = join '', - map { '' . encode_entities($_) . '' } - @{ $c->error }; + $error = join '', map { + '

' + . encode_entities($_) + . '

' + } @{ $c->error }; $error ||= 'No output'; + $error = qq{
$error
}; $title = $name = "$name on Catalyst $Catalyst::VERSION"; + $name = "

$name

"; # Don't show context in the dump delete $c->req->{_context}; @@ -124,14 +126,9 @@ sub finalize_error { my $name = $dump->[0]; my $value = encode_entities( Dumper $dump->[1] ); push @infos, sprintf <<"EOF", $name, $value; -
- - %s - -
-
+

%s

-
%s
+
%s
EOF $i++; @@ -145,28 +142,31 @@ EOF
 (en) Please come back later
 (de) Bitte versuchen sie es spaeter nocheinmal
-(nl) Gelieve te komen later terug
+(at) Konnten's bitt'schoen spaeter nochmal reinschauen
 (no) Vennligst prov igjen senere
-(fr) Veuillez revenir plus tard
-(es) Vuelto por favor mas adelante
-(pt) Voltado por favor mais tarde
-(it) Ritornato prego più successivamente
+(dk) Venligst prov igen senere
+(pl) Prosze sprobowac pozniej
 
$name = ''; } $c->res->body( <<"" ); - + + + + $title -