Branch Coverage

blib/lib/Dancer2/Core/Request.pm
Criterion Covered Total %
branch 107 128 83.5


line true false branch
61 0 738 unless @args % 2 == 0
69 84 654 if (my $s = $opts{'serializer'})
70 1 83 unless $s->$Dancer2::Core::Request::_does("Dancer2::Core::Role::Serializer")
82 53 684 if $opts{'body_params'}
98 8 4 @_ == 2 ? :
142 272 23 unless $_[0]{'is_behind_proxy'}
147 3 138 if ($self->is_behind_proxy and exists $self->env->{'HTTP_X_FORWARDED_HOST'}) { }
165 7 6 unless $_[0]->env->{'HTTP_X_FORWARDED_PROTO'} or $_[0]->env->{'HTTP_X_FORWARDED_PROTOCOL'}
170 14 139 $self->is_behind_proxy ? :
184 654 83 unless my $serializer = $self->serializer
191 52 31 unless grep {$self->method eq $_;} "PUT", "POST", "PATCH", "DELETE"
196 1 30 unless $body and length $body > 0
215 29 1 unless $self->serializer->has_request
217 3 27 if $serializer_fail
226 25 2 XXX ? :
280 104 7 if ($uri->path eq "/")
304 3 12 if $params
308 3 12 $dont_escape ? :
314 31 225 if wantarray and @_ == 1
315 209 16 if @_ == 1
317 5 11 if ($source eq 'query') { }
10 1 elsif ($source eq 'body') { }
318 0 0 unless $self->_query_params
0 5 if wantarray
322 0 0 unless $self->_body_params
0 10 if wantarray
325 1 0 if ($source eq 'route') { }
326 0 1 if wantarray
337 43 4 if ($XS_PARSE_QUERY_STRING) { }
347 2 8 XXX ? :
378 0 3 if ($type)
392 1 1 unless +(shift())->params->{'captures'}
394 1 30 unless +(shift())->params->{'splat'}
401 43 24083 unless defined $h
403 21551 2532 if (not XXX || utf8::is_utf8($h)) { }
657 1875 elsif (ref $h eq 'Hash::MultiValue') { }
1797 78 elsif (XXX) { }
78 0 elsif (XXX) { }
422 0 0 unless defined $self->headers
423 0 0 unless defined $self->header("X-Requested-With")
424 0 0 if $self->header("X-Requested-With") ne "XMLHttpRequest"
434 12 9 unless wantarray
435 3 6 unless defined $res
436 3 3 XXX ? :
444 48 529 $self->_has_params ? :
451 1803 505 XXX ? :
462 32 32 if $XS_URL_DECODE
471 43 534 if defined $self->{'_query_params'}
476 503 31 if not defined $source or $source eq ""
478 21 10 if ($XS_PARSE_QUERY_STRING)
487 0 32 unless defined $key
488 32 0 defined $val ? :
493 6 26 if (exists $query_params->{$key}) { }
495 2 4 if (XXX) { }
530 6 8 @uploads > 1 ? :
534 6 8 @filenames > 1 ? :
549 418 64 unless defined $http_cookie
551 63 1 if ($XS_HTTP_COOKIES) { }
561 2 65 XXX ? :
576 0 53 unless $options
585 38 15 unless $self->{'_query_params'}
587 44 9 unless $params
623 1 1 if $self->serializer
625 0 1 if keys %{$$self{"_body_params"};}