Branch Coverage

blib/lib/HTTP/Request/AsCGI.pm
Criterion Covered Total %
branch 60 92 65.2


line true false branch
25 1 1 $reserved{lc $1} ? :
33 0 7 unless (@_ % 2 == 0 and eval { do { $request->isa('HTTP::Request') } })
44 0 7 unless $uri->scheme
45 0 7 unless $uri->host
46 0 7 unless $uri->port
47 0 7 unless not $host or $host eq $uri->host_port
54 0 7 $uri->scheme eq 'https' ? :
84 2 1 if $field =~ /^Content-(Length|Type)$/
86 3 0 unless (exists $$environment{$key})
91 1 6 unless ($$environment{'SCRIPT_NAME'} eq '/' and $$environment{'PATH_INFO'})
108 1 5 if ($self->request->content_length)
110 0 1 unless $self->stdin->print($self->request->content)
113 0 1 unless $self->stdin->seek(0, 0)
116 0 1 unless $self->stdin->flush
120 0 6 unless open $$self{'restore'}{'stdin'}, '<&' . 'STDIN'->fileno
123 0 6 unless open STDIN, '<&=' . $self->stdin->fileno
128 5 1 if ($self->stdout)
130 0 5 unless open $$self{'restore'}{'stdout'}, '>&' . 'STDOUT'->fileno
133 0 5 unless open STDOUT, '>&=' . $self->stdout->fileno
140 1 5 if ($self->stderr)
142 0 1 unless open $$self{'restore'}{'stderr'}, '>&' . 'STDERR'->fileno
145 0 1 unless open STDERR, '>&=' . $self->stderr->fileno
157 0 6 if ($INC{'CGI.pm'})
169 0 4 unless $self->stdout
171 0 4 unless seek $self->stdout, 0, 0
177 3 12 if $headers =~ /\x0d?\x0a\x0d?\x0a$/
180 1 3 unless (defined $headers)
184 2 2 unless ($headers =~ /^HTTP/)
189 3 1 unless $response->date
194 3 1 if ($message and $message =~ /^(.+)\x0d$/)
198 3 1 if ($status and $status =~ /^(\d\d\d)\s?(.+)?$/)
209 1 3 if ($response->code == 500 and not $length)
217 0 3 if ($callback) { }
223 0 0 if ($handle->read(my $buffer, 4096))
239 3 0 if ($length and not $response->content_length)
255 0 6 unless open STDIN, '<&' . fileno($$self{'restore'}{'stdin'})
258 0 6 unless sysseek $self->stdin, 0, 0
261 5 1 if ($$self{'restore'}{'stdout'})
263 0 5 unless 'STDOUT'->flush
266 0 5 unless open STDOUT, '>&' . fileno($$self{'restore'}{'stdout'})
269 0 5 unless sysseek $self->stdout, 0, 0
273 1 5 if ($$self{'restore'}{'stderr'})
275 0 1 unless 'STDERR'->flush
278 0 1 unless open STDERR, '>&' . fileno($$self{'restore'}{'stderr'})
281 0 1 unless sysseek $self->stderr, 0, 0
292 0 7 if $$self{'setuped'} and not $$self{'restored'}