Skip to content

Commit

Permalink
Do not halt the response on redirect.
Browse files Browse the repository at this point in the history
Use the with_return handler to return immediatly to the dispatcher after the
redirect details have been added to the response.

Resolves PerlDancer#432.
  • Loading branch information
veryrusty committed Nov 4, 2013
1 parent f6a1d27 commit 36f1f4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Dancer2/Core/Context.pm
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ sub redirect {
$destination = $self->request->uri_for( $destination, {}, 1 );
}

$self->response->halt;
$self->response->redirect( $destination, $status );
# Short circuit any remaining before hook / route code
# ('pass' and after hooks are still processed)
$self->with_return->($self->response) if $self->has_with_return;
}


Expand Down

0 comments on commit 36f1f4c

Please sign in to comment.