};
sub flush {
my ($self) = @_;
+ my $res = $self->ctx->res;
+ if ( $res->status =~ /^3/ || length($res->body) ) {
+ $res->content_type('text/plain') unless $res->content_type;
+ return;
+ }
$self->flush_events;
$self->flush_view;
};
foreach my $type (qw/query body/) {
my $meth = "${type}_parameters";
- my $param_hash = $ctx->req->$meth;
+ my $param_hash = { %{$ctx->req->$meth} }; # yeah, FocusStack deletes it
$self->focus_stack->apply_events($param_hash)
if keys %$param_hash;
}
sub flush_view {
my ($self) = @_;
my $res = $self->ctx->res;
- if ( $res->status =~ /^3/ || length($res->body) ) {
- $res->content_type('text/plain') unless $res->content_type;
- return;
- }
$res->body($self->view->render_window($self));
$res->content_type($self->content_type);
};