Branch Coverage

blib/lib/Dancer2/Core/Request.pm
Criterion Covered Total %
branch 109 132 82.5


line true false branch
61 0 779 unless @args % 2 == 0
69 85 694 if (my $s = $opts{'serializer'})
70 1 84 unless $s->$Dancer2::Core::Request::_does("Dancer2::Core::Role::Serializer")
83 53 725 if $opts{'body_params'}
99 8 4 @_ == 2 ? :
143 310 23 unless $_[0]{'is_behind_proxy'}
148 3 157 if ($self->is_behind_proxy and exists $self->env->{'HTTP_X_FORWARDED_HOST'}) { }
166 7 6 unless $_[0]->env->{'HTTP_X_FORWARDED_PROTO'} or $_[0]->env->{'HTTP_X_FORWARDED_PROTOCOL'}
171 14 158 $self->is_behind_proxy ? :
186 7 771 if ($self->content_type and $self->content_type =~ m[^multipart/form-data]i)
194 688 83 unless my $serializer = $self->serializer
201 52 31 unless grep {$self->method eq $_;} "PUT", "POST", "PATCH", "DELETE"
206 1 30 unless $body and length $body > 0
225 29 1 unless $self->serializer->has_request
227 3 27 if $serializer_fail
236 25 2 is_hashref($data) ? :
290 110 7 if ($uri->path eq "/")
313 15 13 if $params
317 3 25 $dont_escape ? :
323 0 0 unless is_coderef($self->{'uri_for_route'})
332 31 234 if wantarray and @_ == 1
333 218 16 if @_ == 1
335 5 11 if ($source eq 'query') { }
10 1 elsif ($source eq 'body') { }
336 0 0 unless $self->_query_params
0 5 if wantarray
340 0 0 unless $self->_body_params
0 10 if wantarray
343 1 0 if ($source eq 'route') { }
344 0 1 if wantarray
355 43 4 if ($XS_PARSE_QUERY_STRING) { }
365 2 8 if (is_arrayref($query->{$key})) { }
396 0 3 if ($type)
410 1 1 unless +(shift())->params->{'captures'}
412 1 30 unless +(shift())->params->{'splat'}
419 43 24266 unless defined $h
421 21580 2686 if (not is_ref($h) || utf8::is_utf8($h)) { }
698 1988 elsif (ref $h eq 'Hash::MultiValue') { }
1908 80 elsif (is_hashref($h)) { }
80 0 elsif (is_arrayref($h)) { }
440 0 0 unless defined $self->headers
441 0 0 unless defined $self->header("X-Requested-With")
442 0 0 if $self->header("X-Requested-With") ne "XMLHttpRequest"
452 12 9 unless wantarray
453 3 6 unless defined $res
454 3 3 is_arrayref($res) ? :
462 48 564 $self->_has_params ? :
469 1908 540 is_hashref($_) ? :
480 32 32 if $XS_URL_DECODE
489 43 569 if defined $self->{'_query_params'}
494 538 31 if not defined $source or $source eq ""
496 21 10 if ($XS_PARSE_QUERY_STRING)
505 0 32 unless defined $key
506 32 0 defined $val ? :
511 6 26 if (exists $query_params->{$key}) { }
513 2 4 if (is_arrayref($prev_val)) { }
548 6 9 @uploads > 1 ? :
552 6 9 @filenames > 1 ? :
567 453 64 unless defined $http_cookie
569 63 1 if ($XS_HTTP_COOKIES) { }
579 2 65 is_arrayref($value) ? :
594 0 53 unless $options
603 38 15 unless $self->{'_query_params'}
605 44 9 unless $params
641 1 1 if $self->serializer
643 0 1 if keys %{$$self{"_body_params"};}