Condition Coverage

blib/lib/Mojolicious/Plugin/TrustedProxy.pm
Criterion Covered Total %
condition 24 38 63.1


and 3 conditions

line !l l&&!r l&&r condition
72 0 0 23 is_ip($ip) and $cidr
0 0 23 is_ip($ip) and $cidr and $cidr->isa('Net::CIDR::Lite')
88 0 4 19 defined $src_addr and $c->is_trusted_source($src_addr)
116 0 2 4 not !$scheme and grep {$scheme eq lc $_;} @{$$conf{'https_values'};}
146 2 0 2 $fwd_for and is_ip($fwd_for)
153 2 0 2 $fwd_by and is_ip($fwd_by)

or 2 conditions

line l !l condition
13 0 7 $ENV{'MOJO_TRUSTEDPROXY_DEBUG'} || 0
22 1 7 $conf->{'ip_headers'} //= ['x-real-ip', 'x-forwarded-for']
26 1 7 $conf->{'scheme_headers'} //= ['x-ssl', 'x-forwarded-proto']
30 1 7 $conf->{'https_values'} //= ['1', 'true', 'https', 'on', 'enable', 'enabled']
34 0 8 $conf->{'parse_forwarded'} // 1
36 3 5 $conf->{'trusted_sources'} //= ['127.0.0.0/8', '10.0.0.0/8']
40 1 7 $conf->{'hide_headers'} //= 0

or 3 conditions

line l !l&&r !l&&!r condition
34 0 8 0 $conf->{'parse_rfc7239'} //= $conf->{'parse_forwarded'} // 1
69 23 0 0 shift() || $c->tx->remote_proxy_address || $c->tx->remote_address