Fix redirect in Dancer to not forcibly apply scheme+host

This commit is contained in:
Oliver Gorwits
2013-10-27 03:05:28 +00:00
parent c0c8edf6f0
commit f90f2b0a67
5 changed files with 26 additions and 10 deletions

View File

@@ -100,4 +100,15 @@ any qr{.*} => sub {
template 'index';
};
{
# https://github.com/PerlDancer/Dancer/issues/967
no warnings 'redefine';
*Dancer::_redirect = sub {
my ($destination, $status) = @_;
my $response = Dancer::SharedData->response;
$response->status($status || 302);
$response->headers('Location' => $destination);
};
}
true;