X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=83866391e252e6063a6b31bda31ffd42d308204e;hb=e5cd6cc061d87d09a29fe67c7c3ab8fc386a5af0;hp=fac70cd89a1a3c6f3a019ab966776301d9821c53;hpb=47b9d68e304e9cb305974bc15aa8e60f4bfb6c45;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index fac70cd..8386639 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -181,7 +181,6 @@ sub finalize_error { $name = "

$name

"; # Don't show context in the dump - $c->req->_clear_context; $c->res->_clear_context; # Don't show body parser in the dump @@ -332,7 +331,7 @@ Allows engines to write headers to response sub finalize_headers { my ($self, $ctx) = @_; - $ctx->response->finalize_headers; + $ctx->finalize_headers unless $ctx->response->finalized_headers; return; } @@ -395,14 +394,17 @@ sub prepare_body_parameters { =head2 $self->prepare_parameters($c) -sets up parameters from query and post parameters. +Sets up parameters from query and post parameters. +If parameters have already been set up will clear +existing parameters and set up again. =cut sub prepare_parameters { my ( $self, $c ) = @_; - $c->request->parameters; + $c->request->_clear_parameters; + return $c->request->parameters; } =head2 $self->prepare_path($c) @@ -670,8 +672,7 @@ sub run { =head2 build_psgi_app ($app, @args) -Builds and returns a PSGI application closure, wrapping it in the reverse proxy -middleware if the using_frontend_proxy config setting is set. +Builds and returns a PSGI application closure. (Raw, not wrapped in middleware) =cut @@ -683,6 +684,7 @@ sub build_psgi_app { return sub { my ($respond) = @_; + confess("Did not get a response callback for writer, cannot continiue") unless $respond; $app->handle_request(env => $env, response_cb => $respond); }; }; @@ -730,4 +732,6 @@ the same terms as Perl itself. =cut +__PACKAGE__->meta->make_immutable; + 1;