Branch Coverage

blib/lib/Mojo/Message/Request.pm
Criterion Covered Total %
branch 81 86 94.1


line true false branch
27 4 15 unless my $content = $self->content->clone
30 1 14 if $self->{'proxy'}
40 175 225 unless @_
43 6 386 ref $_ eq 'HASH' ? :
55 25 1023 unless $$bufref =~ s/^\s*(.*?)\x0d?\x0a//u
58 1 1022 unless $1 =~ m[^(\S+)\s+(\S+)\s+HTTP/(\d\.\d)$]u
61 2 1020 if $1 eq "CONNECT"
62 7 1013 if $target =~ m[^[^:/?#]+:]u
68 970 971 $self->{'fix'} ? :
72 778 193 if ($headers->content_length // "") eq 0 and $self->method eq "GET"
76 942 29 unless $headers->host
79 6 965 if (my $info = $url->userinfo and not $headers->authorization)
84 957 14 unless my $proxy = $self->proxy and $self->via_proxy
85 8 6 unless my $info = $proxy->userinfo
86 6 0 unless $headers->proxy_authorization
110 32 1465 ref $_[0] ? :
113 32 1465 if $env
116 1442 55 if (($self->{'state'} // '') ne 'cgi') { }
122 420 1077 unless $self->is_finished
126 1027 50 unless $base->scheme
128 978 99 if (not $base->host and my $host = $headers->host)
131 7 1070 if (my $basic = _basic($headers->authorization))
135 7 1070 if $basic
138 7 1070 if $self->reverse_proxy and ($headers->header("X-Forwarded-Proto") // "") eq "https"
147 14 2140 $_[0] && $_[0] =~ /Basic (.+)$/u ? :
161 271 59 unless $name =~ s/^HTTP_//iu
166 23 9 $value =~ s/:(\d+)$//u ? :
32 27 if $name eq "HOST"
170 14 18 if $env->{'CONTENT_TYPE'}
173 14 18 if $env->{'CONTENT_LENGTH'}
176 9 23 if $env->{'QUERY_STRING'}
179 32 0 if $env->{'REQUEST_METHOD'}
182 32 0 if ($env->{'SERVER_PROTOCOL'} // "") =~ m[^([^/]+)/([^/]+)$]u
185 1 31 if uc($env->{'HTTPS'} // "") eq "ON"
188 28 4 $env->{'PATH_INFO'} ? :
191 30 2 if (my $value = $env->{'SCRIPT_NAME'})
194 17 13 $value =~ m[/$]u ? :
208 970 968 if defined $self->{'start_buffer'}
213 25 943 unless $path =~ m[^/]u
217 3 965 if ($method eq 'CONNECT') { }
8 959 elsif ($self->proxy and $self->via_proxy and $url->protocol ne 'https') { }
218 0 0 $url->protocol eq 'https' ? :
224 6 2 unless $self->is_handshake