| lib/PAGI/Middleware/Static.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| condition | 36 | 56 | 64.2 |
| line | !l | l&&!r | l&&r | condition |
|---|---|---|---|---|
| 183 | 21 | 1 | 1 | $scope->{'method'} ne "GET" and $scope->{'method'} ne "HEAD" |
| 203 | 0 | 0 | 2 | defined $result and not ref $result |
| 0 | 1 | 1 | defined $result and not ref $result and $result ne 1 | |
| 209 | 0 | 0 | 22 | defined $path and $path ne "" |
| 0 | 21 | 1 | defined $path and $path ne "" and not $path =~ m[^/] | |
| 217 | 0 | 1 | 21 | $file_path and $self->_is_safe_path($file_path) |
| 262 | 16 | 0 | 1 | $if_none_match and $if_none_match eq $etag |
| 285 | 11 | 4 | 1 | $is_range and not defined $start |
| 453 | 4 | 0 | 1 | $start eq "" and $end ne "" |
| 0 | 4 | 0 | $start ne "" and $end eq "" |
| line | l | !l | condition |
|---|---|---|---|
| 166 | 22 | 0 | $config->{'root'} // die("Static middleware requires 'root' option") |
| 168 | 1 | 21 | $config->{'pass_through'} // 0 |
| 169 | 0 | 22 | $config->{'index'} // ["index.html", "index.htm"] |
| 171 | 2 | 20 | $config->{'handle_ranges'} // 1 |
| 430 | 16 | 0 | $ext // "" |
| 431 | 16 | 0 | $MIME_TYPES{$ext} // "application/octet-stream" |
| 438 | 32 | 0 | $scope->{'headers'} // [] |
| line | l | !l&&r | !l&&!r | condition |
|---|---|---|---|---|
| 167 | 2 | 20 | 0 | $config->{'path'} // qr"^/" |
| 183 | 0 | 1 | 22 | $scope->{'type'} ne "http" or $scope->{'method'} ne "GET" and $scope->{'method'} ne "HEAD" |
| 391 | 23 | 0 | 163 | $part eq "" or $part eq "." |
| 467 | 0 | 1 | 4 | $start > $end or $start >= $size |