Branch Coverage

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


line true false branch
52 0 735 unless @args % 2 == 0
60 84 651 if (my $s = $opts{'serializer'})
61 1 83 unless $s->$Dancer2::Core::Request::_does("Dancer2::Core::Role::Serializer")
73 53 681 if $opts{'body_params'}
89 8 4 @_ == 2 ? :
133 272 23 unless $_[0]{'is_behind_proxy'}
138 3 138 if ($self->is_behind_proxy and exists $self->env->{'HTTP_X_FORWARDED_HOST'}) { }
156 7 6 unless $_[0]->env->{'HTTP_X_FORWARDED_PROTO'} or $_[0]->env->{'HTTP_X_FORWARDED_PROTOCOL'}
161 14 139 $self->is_behind_proxy ? :
175 651 83 unless my $serializer = $self->serializer
182 52 31 unless grep {$self->method eq $_;} "PUT", "POST", "PATCH", "DELETE"
187 1 30 unless $body and length $body > 0
206 29 1 unless $self->serializer->has_request
208 3 27 if $serializer_fail
217 25 2 XXX ? :
271 104 7 if ($uri->path eq "/")
295 3 12 if $params
299 3 12 $dont_escape ? :
305 31 221 if wantarray and @_ == 1
306 205 16 if @_ == 1
308 5 11 if ($source eq 'query') { }
10 1 elsif ($source eq 'body') { }
309 0 0 unless $self->_query_params
0 5 if wantarray
313 0 0 unless $self->_body_params
0 10 if wantarray
316 1 0 if ($source eq 'route') { }
317 0 1 if wantarray
328 43 4 if ($XS_PARSE_QUERY_STRING) { }
338 2 8 XXX ? :
369 0 3 if ($type)
383 1 1 unless +(shift())->params->{'captures'}
385 1 30 unless +(shift())->params->{'splat'}
392 43 24071 unless defined $h
394 21551 2520 if (not XXX || utf8::is_utf8($h)) { }
654 1866 elsif (ref $h eq 'Hash::MultiValue') { }
1788 78 elsif (XXX) { }
78 0 elsif (XXX) { }
413 0 0 unless defined $self->headers
414 0 0 unless defined $self->header("X-Requested-With")
415 0 0 if $self->header("X-Requested-With") ne "XMLHttpRequest"
425 12 9 unless wantarray
426 3 6 unless defined $res
427 3 3 XXX ? :
435 48 526 $self->_has_params ? :
442 1794 502 XXX ? :
453 32 32 if $XS_URL_DECODE
462 43 531 if defined $self->{'_query_params'}
467 500 31 if not defined $source or $source eq ""
469 21 10 if ($XS_PARSE_QUERY_STRING)
478 0 32 unless defined $key
479 32 0 defined $val ? :
484 6 26 if (exists $query_params->{$key}) { }
486 2 4 if (XXX) { }
521 6 8 @uploads > 1 ? :
525 6 8 @filenames > 1 ? :
540 415 64 unless defined $http_cookie
542 63 1 if ($XS_HTTP_COOKIES) { }
552 2 65 XXX ? :
567 0 53 unless $options
576 38 15 unless $self->{'_query_params'}
578 44 9 unless $params
614 1 1 if $self->serializer
616 0 1 if keys %{$$self{"_body_params"};}