$name = "<h1>$name</h1>";
# Don't show context in the dump
- $c->req->_clear_context;
$c->res->_clear_context;
# Don't show body parser in the dump
sub finalize_headers {
my ($self, $ctx) = @_;
- $ctx->response->finalize_headers;
+ $ctx->finalize_headers unless $ctx->response->finalized_headers;
return;
}
=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)
=head2 $self->prepare_request(@arguments)
-Sets up the PSGI environment in the Engine (just for back compat).
+Populate the context object from the request object.
=cut
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);
};
};
=cut
+__PACKAGE__->meta->make_immutable;
+
1;