Branch Coverage

blib/lib/PAGI/Server/Protocol/HTTP1.pm
Criterion Covered Total %
branch 74 82 90.2


line true false branch
19 2 730 if ($name =~ /[\r\n\0]/)
24 0 730 if ($name =~ /[[:cntrl:]]/)
33 14 716 if ($value =~ /[\r\n\0]/)
155 10 289 ref $buffer_ref ? :
159 3 296 if $header_end < 0
163 2 294 if ($first_line_end > $self->{'max_request_line_size'})
168 2 292 if ($header_end > $self->{'max_header_size'})
177 1 291 if ($ret == -1)
184 0 291 if $ret < 0
211 866 1772 if (index($key, "HTTP_") == 0)
217 1 865 if ($header_name eq "cookie")
223 6 859 if ($header_name eq "transfer-encoding")
225 4 2 if (@codings and $codings[-1] eq 'chunked') { }
1 1 elsif (grep {$_ eq 'chunked';} @codings) { }
236 1 864 if ($header_name eq "expect" and lc $value eq "100-continue")
245 1 290 if (@cookie_values)
250 1 290 if (@headers > $self->{'max_header_count'})
255 8 282 if (defined $env{'CONTENT_TYPE'})
258 18 272 if (defined $env{'CONTENT_LENGTH'})
263 4 14 unless ($cl_value =~ /^\d+$/)
269 1 13 if (length $cl_value > 10 or $cl_value > 2147483647)
278 1 284 if ($te_bad_order)
281 1 283 if ($te_unsupported)
287 1 282 if ($chunked and defined $content_length)
293 282 0 if ($env{'SERVER_PROTOCOL'} and index($env{'SERVER_PROTOCOL'}, "HTTP/") == 0)
300 1 281 if ($http_version eq "1.1" and not defined $env{'HTTP_HOST'})
331 1 727 if lc $name eq "server"
338 268 1 unless ($has_server)
344 176 93 if ($chunked and $http_version eq "1.1")
356 0 1 unless defined $chunk and length $chunk
358 1 0 if ($chunked) { }
363 1 0 unless ($more)
403 67 196 if ($now != $_cached_date_time)
431 0 16 ref $buffer_ref ? :
439 0 25 if $crlf < 0
447 4 21 if ($size_line eq "" or not $size_line =~ /^[0-9a-fA-F]+$/)
453 1 20 if (length $size_line > 7)
460 2 18 if ($chunk_size > $self->{'max_chunk_size'})
468 1 17 if (length $buffer < $chunk_end)
473 9 8 if ($chunk_size > 0)
480 8 9 if ($chunk_size == 0)