NotCacheableHeaders.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 27 / 27 CC 2 SCAR 2.5
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary NotCachableHeaders.pm »
1 package Catalyst::ActionRole::NotCacheableHeaders;
2 3 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 $Catalyst::ActionRole::NotCacheableHeaders::VERSION = '0.02';
4 }
5 # ABSTRACT: Set no cache headers for actions
6  
7 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use HTTP::Date qw(time2str);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶after 'execute' => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
12 5 my $self = shift;
13 5 my ($controller, $c, @args) = @_;
14  
15 5 ▶ if ( exists $c->action->attributes->{NotCacheable} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $c->action->attributes->{"NotCacheable"}) 4 1 5
16 4 $c->response->header(
17 'Expires' => 'Thu, 01 Jan 1970 00:00:00 GMT',
18 'Pragma' => 'no-cache',
19 'Cache-Control' => 'no-cache',
20 'Last-Modified' => time2str( time ),
21 );
22 }
23 3 };
24  
25 3 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 3 1; # End of Catalyst::ActionRole::NotCacheableHeaders
28  
29  
30  
31 __END__
↑ Summary NotCachableHeaders.pm »