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

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