Branch Coverage

blib/lib/Dancer/Plugin/CORS.pm
Criterion Covered Total %
branch 66 76 86.8


line true false branch
39 0 30 unless (defined $current_route)
43 22 8 unless (_handle($current_route))
46 16 2 if ($current_route->match($request))
59 0 30 if (ref $route eq 'ARRAY')
63 22 8 if (blessed $route and $route->isa('Dancer::Route'))
75 25 5 unless (exists $$routes{$route})
77 8 17 unless (ref $route)
90 0 52 unless (exists $$routes{$path} or exists $$routes{$route})
100 4 48 unless (defined $origin)
105 0 48 unless (_isuri $origin)
110 28 20 $preflight ? :
114 0 48 unless (defined $requested_method)
123 37 11 if (exists $$routes{$route}) { }
139 46 3 if (exists $$options{'origin'}) { }
141 5 41 if ($reftype eq 'CODE') { }
2 39 elsif ($reftype eq 'ARRAY') { }
2 37 elsif ($reftype eq 'Regexp') { }
37 0 elsif ($reftype eq '') { }
142 3 2 unless ($$options{'origin'}('URI'->new($origin)))
147 1 1 unless (_isin $origin, @{$$options{'origin'};})
152 1 1 unless ($origin =~ /$$options{'origin'}/)
157 5 32 unless ($$options{'origin'} eq $origin)
168 36 3 if $origin ne '*'
170 3 36 if (exists $$options{'timing'})
171 2 1 if (defined $$options{'timing'} and $$options{'timing'} eq '1') { }
178 2 37 if (exists $$options{'credentials'})
179 2 0 unless (not $$options{'credentials'})
180 1 1 if ($origin eq '*')
188 2 36 if (exists $$options{'expose'})
192 10 28 if (exists $$options{'methods'}) { }
28 0 elsif (exists $$options{'method'}) { }
193 7 3 unless (_isin lc $requested_method, map(lc($_), @{$$options{'methods'};}))
199 10 18 unless ($$options{'method'} eq $requested_method)
206 2 19 if (exists $$options{'headers'}) { }
0 19 elsif (@requested_headers) { }
208 0 2 unless (_isin lc $requested_header, map(lc($_), @{$$options{'headers'};}))
218 2 19 if ($preflight and exists $$options{'maxage'})
232 21 27 if ($ok) { }