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