Branch Coverage

blib/lib/Mojolicious/Static.pm
Criterion Covered Total %
branch 49 50 98.0


line true false branch
26 147 746 unless $method eq 'GET' or $method eq 'HEAD'
31 63 683 $stash->{'path'} ? :
32 73 673 unless my(@parts) = @{$path->canonicalize->parts;}
36 616 57 if $canon_path =~ m[^\.\./|\\] or not $self->serve($c, $canon_path)
47 649 31 unless my $asset = _get_file(path($path, @parts)->to_string)
52 15 629 if (my $asset = $self->_get_data_file($rel))
56 17 612 exists $extra->{$rel} ? :
64 69 9 if $last
65 74 4 if $etag
70 65 13 unless my $since = $req_headers->if_modified_since or $match
74 1 12 if $match and not grep({trim($_) eq $etag;} split(/,/, $match, 0))
77 6 6 unless $last //= $res_headers->last_modified and $since
83 612 63 unless my $asset = $self->file($rel)
92 49 18 if $asset->is_file
99 3 64 if $self->is_fresh($c, $options)
102 48 16 unless my $range = $c->req->headers->range
106 1 15 unless my $size = $asset->size
107 0 15 unless $range =~ /^bytes=(\d+)?-(\d+)?/
108 10 5 defined $2 && $2 < $size ? :
109 3 12 if $start > $end
131 551 93 if not $rel =~ /\.\w+$/ or $rel =~ /\.\w+\.\w+$/
133 12 81 unless $self->{'index'}
137 78 15 unless defined(my $data = data_section(@args))
138 7 8 file_is_binary(@args) ? :
145 48 649 -f $path && -r _ ? :