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 24 is_ip($ip) and $cidr
0 0 24 is_ip($ip) and $cidr and $cidr->isa('Net::CIDR::Lite')
88 0 4 20 defined $src_addr and $c->is_trusted_source($src_addr)
116 0 2 4 not !$scheme and grep {$scheme eq lc $_;} @{$$conf{'https_values'};}
148 3 0 2 $fwd_for and is_ip($fwd_for)
155 3 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-forwarded-for', 'x-real-ip']
26 1 7 $conf->{'scheme_headers'} //= ['x-forwarded-proto', 'x-ssl']
30 1 7 $conf->{'https_values'} //= ['https', 'on', '1', 'true', '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 24 0 0 shift() || $c->tx->remote_proxy_address || $c->tx->remote_address