blib/lib/Yukki/Web/Controller/Redirect.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 2 SCAR 12.8
CC
2
Cov
0%
fire
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 package Yukki::Web::Controller::Redirect;
2 {
3 $Yukki::Web::Controller::Redirect::VERSION = '0.140290';
4 }
5 use 5.12.1;
6 use Moose;
7  
8 use Yukki::Error qw( http_throw );
9  
10 # ABSTRACT: Simple controller for handling internal redirects
11  
12  
13 sub fire {
14 my ($self, $ctx) = @_;
15  
16 my $redirect = $ctx->request->path_parameters->{redirect};
17  
18 http_throw("no redirect URL named") unless $redirect;
19
20 http_throw("Go to $redirect.", {
21 status => 'MovedPermanently',
22 location => $redirect,
23 });
24 }
25  
26 1;
27  
28 __END__