Condition Coverage

blib/lib/Mojolicious/Plugin/HttpBasicAuth.pm
Criterion Covered Total %
condition 12 19 63.1


and 3 conditions

line !l l&&!r l&&r condition
41 0 108 36 $options{'validate'} and $options{'validate'}($controller, split(/:/, $auth, 2), $options{'realm'})
54 18 0 144 $auth and $auth =~ /Basic (.*)/

or 2 conditions

line l !l condition
15 0 1 $defaults{'realm'} //= 'WWW'
18 1 0 $defaults{'validate'} //= sub { die 'please define a validate callback'; }
26 0 1 $defaults{'invalid'} //= sub { my $controller = shift(); return 'json', {'json', {'error', 'HTTP 401: Unauthorized'}}, 'html', {'template', 'auth/basic'}, 'any', {'data', 'HTTP 401: Unauthorized'}; }
31 162 0 shift() // {}
35 144 18 $plugin->_auth_header($controller) || ''

or 3 conditions

line l !l&&r !l&&!r condition
52 144 0 18 $controller->req->headers->authorization || $controller->req->env->{'X_HTTP_AUTHORIZATION'} || $controller->req->env->{'HTTP_AUTHORIZATION'}