Branch Coverage

blib/lib/Plack/Middleware/CrossOrigin.pm
Criterion Covered Total %
branch 40 40 100.0


line true false branch
72 4 2 unless ref $self->origins
75 4 2 unless ref $self->methods
78 4 2 unless ref $self->headers
81 5 1 unless ref $self->expose_headers
94 13 7 if ($origin) { }
3 4 elsif ($$env{'REQUEST_METHOD'} eq 'GET' and $$env{'HTTP_USER_AGENT'} and $$env{'HTTP_USER_AGENT'} =~ m[\bAppleWebKit/(\d+\.\d+)] and $1 < 534.19 and $$env{'HTTP_REFERER'} and $$env{'HTTP_REFERER'} =~ m[\A ( \w+://[^/]+ )]msx) { }
119 3 13 $request_headers ? :
122 4 12 $continue_on_failure && !$preflight ? :
134 5 11 if ($$allowed_origins_h{'*'}) { }
5 6 elsif (not $$allowed_origins_h{$origin}) { }
141 7 4 if ($preflight)
142 3 4 if ($$allowed_methods_h{'*'}) { }
1 3 elsif (not $$allowed_methods_h{$request_method}) { }
148 2 4 if ($$allowed_headers_h{'*'}) { }
1 3 elsif (grep {not defined $_;} @{$allowed_headers_h;}{map lc($_), @request_headers}) { }
155 1 8 if ($self->credentials) { }
4 4 elsif ($$allowed_origins_h{'*'}) { }
164 5 4 if ($preflight) { }
165 3 2 if (defined $self->max_age)
180 3 6 if ($$expose_headers_h{'*'})