X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=1a2d3eed4817e8955c3bc45bf4a07c0b70db801c;hb=a739692c785a7a0ac8164034c1e0b7e93d7ac71a;hp=cbc5896993ba66a413b1b9f282eac72ede2957c2;hpb=8fbcd90cdb30aed53d22d1cdbad95880f1c11693;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index cbc5896..1a2d3ee 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -179,12 +179,13 @@ sub finalize { $c->finalize_error; } - if ( !$c->response->body_length && $c->response->status !~ /^(1|3)\d\d$/ ) { + if ( !$c->response->body && $c->response->status !~ /^(1|3)\d\d$/ ) { $c->finalize_error; } - if ( $c->response->body_length && !$c->response->content_length ) { - $c->response->content_length( $c->response->body_length ); + if ( $c->response->body && !$c->response->content_length ) { + use bytes; # play safe with a utf8 aware perl + $c->response->content_length( length $c->response->body ); } my $status = $c->finalize_headers; @@ -400,7 +401,6 @@ sub prepare { request => Catalyst::Request->new( { arguments => [], - body => undef, cookies => {}, headers => HTTP::Headers->new, parameters => {}, @@ -409,12 +409,7 @@ sub prepare { } ), response => Catalyst::Response->new( - { - body => undef, - cookies => {}, - headers => HTTP::Headers->new, - status => 200 - } + { cookies => {}, headers => HTTP::Headers->new, status => 200 } ), stash => {}, state => 0 @@ -430,10 +425,10 @@ sub prepare { } $c->prepare_request($engine); - $c->prepare_connection; + $c->prepare_path; $c->prepare_headers; $c->prepare_cookies; - $c->prepare_path; + $c->prepare_connection; $c->prepare_action; my $method = $c->req->method || '';