Branch Coverage

blib/lib/Dancer/Request.pm
Criterion Covered Total %
branch 106 138 76.8


line true false branch
41 0 611 if (@args == 1)
56 0 1 unless $_[0]->env->{'X_FORWARDED_FOR'}
61 0 19 setting('behind_proxy') ? :
63 0 34 if (@_ == 2) { }
67 5 29 if setting("behind_proxy")
68 12 17 unless $host or $_[0]{'host'}
77 0 1 unless $_[0]->env->{'REQUEST_BASE'}
80 5 28 if (setting("behind_proxy"))
119 563 52 unless $_[0]->env->{'psgi.input'}
140 611 0 unless $self->path
141 611 0 unless $self->path_info
142 611 0 unless $self->method
149 611 0 unless $self->uploads
177 1 542 defined $body ? :
543 28 unless exists $env->{'CONTENT_LENGTH'}
183 0 571 defined $store_raw_body ? :
184 571 0 if ($store_raw_body)
204 2 14 if (exists $to_data->{'options'}{'method'})
205 0 2 unless _valid_method($to_data->{'options'}{'method'})
216 15 1 if (my $session = 'Dancer::Session'->engine && 'Dancer::Session'->get_current_session)
224 15 0 unless ($new_request->{'env'}{'COOKIE'} =~ /$name\s*=/)
245 0 16 unless ref $to_add eq "HASH"
271 5 27 if (setting('behind_proxy')) { }
287 2 1 if ($uri->path eq "/")
304 20 6 if $params
306 20 6 $dont_escape ? :
314 289 147 unless ($self->{'_params_are_decoded'})
322 15 421 if wantarray and @_ == 1
323 402 19 if @_ == 1
325 4 15 if ($source eq 'query') { }
15 0 elsif ($source eq 'body') { }
326 2 2 if wantarray
330 0 15 if wantarray
333 0 0 if ($source eq 'route') { }
334 0 0 if wantarray
344 12 2526 unless defined $h
346 622 28 unless (ref $h or utf8::is_utf8($h))
350 1793 111 if (ref $h eq "HASH")
357 83 28 if (ref $h eq "ARRAY")
369 0 614 if (defined $self->{'x_requested_with'})
370 0 0 if ($self->{'x_requested_with'} eq "XMLHttpRequest")
375 610 4 unless defined $self->headers
376 3 1 unless defined $self->header("X-Requested-With")
377 0 1 if $self->header("X-Requested-With") ne "XMLHttpRequest"
386 5 3 unless wantarray
387 1 2 unless defined $res
388 1 1 ref $res eq 'ARRAY' ? :
446 47 2403 if ($self->is_forward) { }
466 11 600 if defined $self->script_name
467 604 7 if defined $self->env->{'PATH_INFO'}
471 526 85 if (defined $self->request_uri)
475 0 611 unless $path
482 604 7 if (defined $info) { }
509 1808 595 if defined $self->{'_body_params'}
517 1839 611 if defined $self->{'_query_params'}
523 0 40 unless defined $key
524 40 0 defined $val ? :
529 4 36 if (exists $self->{'_query_params'}{$key}) { }
531 0 4 if (ref $prev_val and ref $prev_val eq 'ARRAY') { }
550 563 32 unless $self->_has_something_to_read
552 20 12 if ($self->content_length > 0)
556 0 20 defined $store_raw_body ? :
564 20 0 if ($store_raw_body)
584 20 20 if $remaining <= 0
586 0 20 $remaining > $maxlength ? :
592 20 0 if (defined $rc) { }
610 2 7 ref $files eq 'ARRAY' ? :
624 2 7 @uploads > 1 ? :
628 2 7 @filenames > 1 ? :