| 1 | package Unblock::HTTP2::_Headers; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 30 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 30 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 30 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 30 | ▶ | use Uniform::HTTP::FastPath 0.06 (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 30 | ▶ | use Uniform::HTTP::Request 0.06; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 30 | ▶ | use Uniform::HTTP::Response 0.06; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 30 | our $VERSION = '0.12'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 30 | my %FORBIDDEN = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | connection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | keep-alive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | proxy-connection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | transfer-encoding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | upgrade | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 30 | my $TOKEN_RE = qr/\A[!\#\$%&'*+\-.\^_`|~0-9A-Za-z]+\z/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 87 | ▶ | sub native_message { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
native_message: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 87 | my ($class, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 87 | ▶ | return unless Uniform::HTTP::FastPath::can_view($message); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 86 | return $message; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | ▶ | sub _received_flags { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_received_flags: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 5 | my ($kind, $end_stream) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 5 | my $flags = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | Uniform::HTTP::FastPath::FLAG_HEADERS_LOSSLESS() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | | Uniform::HTTP::FastPath::FLAG_TRAILERS_LOSSLESS(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 5 | ▶ | $flags |= Uniform::HTTP::FastPath::FLAG_TARGET_EXACT() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | if $kind == Uniform::HTTP::FastPath::KIND_REQUEST(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 5 | ▶ | if ($end_stream) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 3 | $flags |= Uniform::HTTP::FastPath::FLAG_COMPLETE() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | | Uniform::HTTP::FastPath::FLAG_HAS_BUFFERED_BODY(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | $flags |= Uniform::HTTP::FastPath::FLAG_MUTABLE() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | | Uniform::HTTP::FastPath::FLAG_BODY_MUTABLE() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | | Uniform::HTTP::FastPath::FLAG_TRAILERS_MUTABLE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 5 | return $flags; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 13 | ▶ | sub _validate_request_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_request_value: called CC=20 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 13 | my ($operation, $name, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 13 | ▶ | if ($name eq 'method' || $name eq 'protocol') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$name eq "method" or $name eq "protocol"
MC/DC100%2/2
$name eq "method" or $name eq "protocol"
$name eq "method"
$name eq "protocol"
Truth table100%3/3
A or B
A= $name eq "method"B= $name eq "protocol"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 4 | ▶ | croak "$operation: $name must be an HTTP token" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $value and not ref $value and $value =~ /$TOKEN_RE/
defined $value and not ref $value
MC/DC0%0/3
defined $value and not ref $value and $value =~ /$TOKEN_RE/
defined $value
not ref $value
$value =~ /$TOKEN_RE/
Truth table25%1/4
A and not(B) and C
A= defined $valueB= not ref $valueC= $value =~ /$TOKEN_RE/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | unless defined($value) && !ref($value) && $value =~ $TOKEN_RE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 9 | ▶ | if ($name eq 'target') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 3 | ▶ | croak "$operation: target must not be empty" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $value and not ref $value and length $value
defined $value and not ref $value
MC/DC0%0/3
defined $value and not ref $value and length $value
defined $value
not ref $value
length $value
Truth table25%1/4
A and not(B) and C
A= defined $valueB= not ref $valueC= length $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | unless defined($value) && !ref($value) && length($value); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 3 | ▶ | croak "$operation: target contains spaces or control bytes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | if $value =~ /[\x00-\x20\x7f]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 6 | ▶ | if ($name eq 'scheme') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 3 | ▶ | croak "$operation: scheme must be a valid URI scheme" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $value and not ref $value and $value =~ /\A[A-Za-z][A-Za-z0-9+.-]*\z/
defined $value and not ref $value
MC/DC0%0/3
defined $value and not ref $value and $value =~ /\A[A-Za-z][A-Za-z0-9+.-]*\z/
defined $value
not ref $value
$value =~ /\A[A-Za-z][A-Za-z0-9+.-]*\z/
Truth table25%1/4
A and not(B) and C
A= defined $valueB= not ref $valueC= $value =~ /\A[A-Za-z][A-Za-z0-9+.-]*\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | unless defined($value) && !ref($value) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | && $value =~ /\A[A-Za-z][A-Za-z0-9+.-]*\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 3 | ▶ | if ($name eq 'authority') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 3 | ▶ | croak "$operation: authority must not be empty" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $value and not ref $value and length $value
defined $value and not ref $value
MC/DC0%0/3
defined $value and not ref $value and length $value
defined $value
not ref $value
length $value
Truth table25%1/4
A and not(B) and C
A= defined $valueB= not ref $valueC= length $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | unless defined($value) && !ref($value) && length($value); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 3 | ▶ | croak "$operation: authority contains a prohibited delimiter or control byte" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | if $value =~ /[\x00-\x20\x7f\/?#]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | croak "$operation: unknown request value '$name'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 14 | ▶ | sub _pairs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pairs: called CC=9 SCAR=28.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 14 | my ($operation, $pairs) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 14 | ▶ | croak "$operation: header block must be an array reference" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | unless ref($pairs) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 14 | for my $pair (@$pairs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 44 | ▶ | croak "$operation: each field must be a [name, value] pair" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $pair eq "ARRAY" and @$pair == 2
MC/DC0%0/2
ref $pair eq "ARRAY" and @$pair == 2
ref $pair eq "ARRAY"
@$pair == 2
Truth table33%1/3
A and B
A= ref $pair eq "ARRAY"B= @$pair == 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | unless ref($pair) eq 'ARRAY' && @$pair == 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 44 | ▶ | croak "$operation: field name and value must be defined scalars" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
not defined $pair->[0] or ref $pair->[0] or not defined $pair->[1] or ref $pair->[1]
not defined $pair->[0] or ref $pair->[0] or not defined $pair->[1]
not defined $pair->[0] or ref $pair->[0]
MC/DC0%0/4
not defined $pair->[0] or ref $pair->[0] or not defined $pair->[1] or ref $pair->[1]
not defined $pair->[0]
ref $pair->[0]
not defined $pair->[1]
ref $pair->[1]
Truth table20%1/5
not(A) or B or not(C) or D
A= not defined $pair->[0]B= ref $pair->[0]C= not defined $pair->[1]D= ref $pair->[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | if !defined($pair->[0]) || ref($pair->[0]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | || !defined($pair->[1]) || ref($pair->[1]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 14 | return $pairs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 27 | ▶ | sub _check_normal_field { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_normal_field: called CC=7 SCAR=20.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 27 | my ($operation, $name, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 27 | ▶ | croak "$operation: HTTP/2 field names must be lowercase" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | unless $name eq lc $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 26 | ▶ | croak "$operation: field name must be an HTTP token" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | unless $name =~ $TOKEN_RE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 26 | ▶ | croak "$operation: field value contains a prohibited control byte" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | if $value =~ /[\x00-\x08\x0a-\x1f\x7f]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | croak "$operation: HTTP/2 forbids connection-specific field '$name'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 26 | ▶ | if $FORBIDDEN{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 25 | ▶ | croak "$operation: HTTP/2 TE is limited to trailers" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$name eq "te" and lc $value ne "trailers"
MC/DC0%0/2
$name eq "te" and lc $value ne "trailers"
$name eq "te"
lc $value ne "trailers"
Truth table33%1/3
A and B
A= $name eq "te"B= lc $value ne "trailers"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | if $name eq 'te' && lc($value) ne 'trailers'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 25 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 11 | ▶ | sub _normal_field { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_normal_field: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 11 | my ($operation, $name, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 11 | _check_normal_field($operation, $name, $value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 11 | return [ $name, $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 14 | ▶ | sub _split_header_block { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_split_header_block: called CC=6 SCAR=18.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 14 | my ($operation, $pairs, $allowed) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 14 | _pairs($operation, $pairs); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 14 | my %pseudo; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | my @normal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 14 | my $saw_normal = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 14 | for my $pair (@$pairs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 44 | my ($name, $value) = @$pair; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 44 | ▶ | if (substr($name, 0, 1) eq ':') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 28 | ▶ | croak "$operation: pseudo-header follows a regular field" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | if $saw_normal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | croak "$operation: unsupported pseudo-header '$name'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 28 | ▶ | unless $allowed->{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | croak "$operation: duplicate pseudo-header '$name'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 28 | ▶ | if exists $pseudo{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 28 | $pseudo{$name} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 28 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 16 | $saw_normal = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 16 | _check_normal_field($operation, $name, $value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 14 | push @normal, $pair; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 12 | return (\%pseudo, \@normal); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 6 | ▶ | sub request_from_headers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request_from_headers: called CC=27 SCAR=41.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 6 | my ($class, $pairs, %option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 6 | ▶ | my $end_stream = delete($option{end_stream}) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 6 | ▶ | croak 'request_from_headers(): unknown options: ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | . join(', ', sort keys %option) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | if %option; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 6 | my ($pseudo, $normal) = _split_header_block( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 'request_from_headers()', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | $pairs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | ':method' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | ':scheme' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | ':authority' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | ':path' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | ':protocol' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 4 | my $method = $pseudo->{':method'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 4 | ▶ | croak 'request_from_headers(): missing :method' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $method and length $method
MC/DC0%0/2
defined $method and length $method
defined $method
length $method
Truth table33%1/3
A and B
A= defined $methodB= length $method
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | unless defined($method) && length($method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 4 | my ($target, $scheme, $authority, $protocol); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 4 | ▶ | if (uc($method) eq 'CONNECT') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | croak 'request_from_headers(): CONNECT requires :authority' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | unless defined($pseudo->{':authority'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | ▶ | && length($pseudo->{':authority'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":authority"} and length $pseudo->{":authority"}
MC/DC0%0/2
defined $pseudo->{":authority"} and length $pseudo->{":authority"}
defined $pseudo->{":authority"}
length $pseudo->{":authority"}
Truth table33%1/3
A and B
A= defined $pseudo->{":authority"}B= length $pseudo->{":authority"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 1 | $authority = $pseudo->{':authority'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | ▶ | if (exists $pseudo->{':protocol'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 1 | $protocol = $pseudo->{':protocol'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 1 | ▶ | croak 'request_from_headers(): extended CONNECT requires nonempty :protocol' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $protocol and length $protocol
MC/DC0%0/2
defined $protocol and length $protocol
defined $protocol
length $protocol
Truth table33%1/3
A and B
A= defined $protocolB= length $protocol
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | unless defined($protocol) && length($protocol); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | croak 'request_from_headers(): extended CONNECT requires :scheme' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | unless defined($pseudo->{':scheme'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 1 | ▶ | && length($pseudo->{':scheme'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":scheme"} and length $pseudo->{":scheme"}
MC/DC0%0/2
defined $pseudo->{":scheme"} and length $pseudo->{":scheme"}
defined $pseudo->{":scheme"}
length $pseudo->{":scheme"}
Truth table33%1/3
A and B
A= defined $pseudo->{":scheme"}B= length $pseudo->{":scheme"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | croak 'request_from_headers(): extended CONNECT requires :path' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | unless defined($pseudo->{':path'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 1 | ▶ | && length($pseudo->{':path'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":path"} and length $pseudo->{":path"}
MC/DC0%0/2
defined $pseudo->{":path"} and length $pseudo->{":path"}
defined $pseudo->{":path"}
length $pseudo->{":path"}
Truth table33%1/3
A and B
A= defined $pseudo->{":path"}B= length $pseudo->{":path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 1 | $scheme = $pseudo->{':scheme'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 1 | $target = $pseudo->{':path'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | croak 'request_from_headers(): ordinary CONNECT must omit :scheme and :path' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | if exists($pseudo->{':scheme'}) || exists($pseudo->{':path'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $pseudo->{":scheme"} or exists $pseudo->{":path"}
MC/DC0%0/2
exists $pseudo->{":scheme"} or exists $pseudo->{":path"}
exists $pseudo->{":scheme"}
exists $pseudo->{":path"}
Truth table0%0/3
A or B
A= exists $pseudo->{":scheme"}B= exists $pseudo->{":path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $target = $authority; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | croak 'request_from_headers(): :protocol requires CONNECT' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 3 | ▶ | if exists $pseudo->{':protocol'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | croak 'request_from_headers(): missing :scheme' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | unless defined($pseudo->{':scheme'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 2 | ▶ | && length($pseudo->{':scheme'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":scheme"} and length $pseudo->{":scheme"}
MC/DC0%0/2
defined $pseudo->{":scheme"} and length $pseudo->{":scheme"}
defined $pseudo->{":scheme"}
length $pseudo->{":scheme"}
Truth table33%1/3
A and B
A= defined $pseudo->{":scheme"}B= length $pseudo->{":scheme"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | croak 'request_from_headers(): missing :path' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | unless defined($pseudo->{':path'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 2 | ▶ | && length($pseudo->{':path'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":path"} and length $pseudo->{":path"}
MC/DC0%0/2
defined $pseudo->{":path"} and length $pseudo->{":path"}
defined $pseudo->{":path"}
length $pseudo->{":path"}
Truth table33%1/3
A and B
A= defined $pseudo->{":path"}B= length $pseudo->{":path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | croak 'request_from_headers(): missing :authority' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | unless defined($pseudo->{':authority'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 2 | ▶ | && length($pseudo->{':authority'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $pseudo->{":authority"} and length $pseudo->{":authority"}
MC/DC0%0/2
defined $pseudo->{":authority"} and length $pseudo->{":authority"}
defined $pseudo->{":authority"}
length $pseudo->{":authority"}
Truth table33%1/3
A and B
A= defined $pseudo->{":authority"}B= length $pseudo->{":authority"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 2 | $scheme = $pseudo->{':scheme'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | $authority = $pseudo->{':authority'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 2 | $target = $pseudo->{':path'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 3 | _validate_request_value('request_from_headers()', 'method', $method); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 3 | _validate_request_value('request_from_headers()', 'target', $target); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 3 | _validate_request_value('request_from_headers()', 'authority', $authority); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 3 | ▶ | _validate_request_value('request_from_headers()', 'scheme', $scheme) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | if defined $scheme; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 3 | ▶ | _validate_request_value('request_from_headers()', 'protocol', $protocol) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | if defined $protocol; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 3 | ▶ | my $view = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | Uniform::HTTP::FastPath::ABI_VERSION(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | Uniform::HTTP::FastPath::KIND_REQUEST(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | _received_flags( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | Uniform::HTTP::FastPath::KIND_REQUEST(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | $end_stream, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | '2', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | $method, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | $target, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | $scheme, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | $authority, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | $protocol, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | $normal, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | $end_stream ? '' : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 3 | return Uniform::HTTP::FastPath::request_from_validated($view); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 2 | ▶ | sub response_from_headers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
response_from_headers: called CC=9 SCAR=26.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | my ($class, $pairs, %option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 2 | ▶ | my $end_stream = delete($option{end_stream}) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 2 | ▶ | croak 'response_from_headers(): unknown options: ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | . join(', ', sort keys %option) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | if %option; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 2 | my ($pseudo, $normal) = _split_header_block( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 'response_from_headers()', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | $pairs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | { ':status' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 2 | my $status = $pseudo->{':status'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 2 | ▶ | croak 'response_from_headers(): missing :status' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $status and length $status
MC/DC0%0/2
defined $status and length $status
defined $status
length $status
Truth table33%1/3
A and B
A= defined $statusB= length $status
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | unless defined($status) && length($status); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 2 | ▶ | croak 'response_from_headers(): status must be an integer from 100 through 599' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$status =~ /\A[0-9]+\z/ and $status >= 100 and $status <= 599
$status =~ /\A[0-9]+\z/ and $status >= 100
MC/DC0%0/3
$status =~ /\A[0-9]+\z/ and $status >= 100 and $status <= 599
$status =~ /\A[0-9]+\z/
$status >= 100
$status <= 599
Truth table25%1/4
A and B and C
A= $status =~ /\A[0-9]+\z/B= $status >= 100C= $status <= 599
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | unless $status =~ /\A[0-9]+\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | && $status >= 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | && $status <= 599; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 2 | ▶ | my $view = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | Uniform::HTTP::FastPath::ABI_VERSION(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | Uniform::HTTP::FastPath::KIND_RESPONSE(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | _received_flags( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | Uniform::HTTP::FastPath::KIND_RESPONSE(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | $end_stream, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | '2', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 + $status, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | $normal, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | $end_stream ? '' : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 2 | return Uniform::HTTP::FastPath::response_from_validated($view); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 6 | ▶ | sub apply_trailers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
apply_trailers: called CC=5 SCAR=17.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 6 | my ($class, $message, $pairs) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 6 | ▶ | croak 'apply_trailers(): requires a canonical Uniform HTTP message' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
builtin::blessed($message) and $message->can("add_trailer") and $message->can("freeze_trailers")
builtin::blessed($message) and $message->can("add_trailer")
MC/DC0%0/3
builtin::blessed($message) and $message->can("add_trailer") and $message->can("freeze_trailers")
builtin::blessed($message)
$message->can("add_trailer")
$message->can("freeze_trailers")
Truth table25%1/4
A and B and C
A= builtin::blessed($message)B= $message->can("add_trailer")C= $message->can("freeze_trailers")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | unless blessed($message) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | && $message->can('add_trailer') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | && $message->can('freeze_trailers'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 6 | my ($pseudo, $normal) = _split_header_block( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 'apply_trailers()', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | $pairs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 6 | for my $field (@$normal) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 9 | $message->add_trailer(@$field); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 6 | $message->freeze_trailers; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 6 | return $message; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 4 | ▶ | sub _request_contract { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_request_contract: called CC=4 SCAR=14.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 4 | my ($request) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 4 | ▶ | return unless blessed($request); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 4 | for my $method (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | method target scheme authority protocol version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | header_count header_name header_value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | trailer_count trailer_name trailer_value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | has_buffered_body body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 56 | ▶ | return unless $request->can($method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 4 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | ▶ | sub _response_contract { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_response_contract: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | my ($response) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ▶ | return unless blessed($response); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | for my $method (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | status version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | header_count header_name header_value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | trailer_count trailer_name trailer_value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | has_buffered_body body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | ▶ | return unless $response->can($method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 4 | ▶ | sub _check_version { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_version: called CC=3 SCAR=12.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 4 | my ($operation, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 4 | my $version = $message->version; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 4 | ▶ | croak "$operation: explicit HTTP version must be 2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $version and $version ne 2
MC/DC0%0/2
defined $version and $version ne 2
defined $version
$version ne 2
Truth table33%1/3
A and B
A= defined $versionB= $version ne 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | if defined($version) && $version ne '2'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 4 | ▶ | sub normal_fields { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
normal_fields: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 4 | my ($class, $operation, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 4 | my @fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 4 | for my $index (0 .. $message->header_count - 1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 2 | my $name = lc $message->header_name($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 2 | my $value = $message->header_value($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 2 | push @fields, _normal_field($operation, $name, $value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 4 | return \@fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 95 | ▶ | sub trailer_fields { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trailer_fields: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 95 | my ($class, $operation, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 95 | my $count = $message->trailer_count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 95 | ▶ | croak "$operation: trailer section is unavailable" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | unless defined $count; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 95 | my @fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 95 | for my $index (0 .. $count - 1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 9 | my $name = lc $message->trailer_name($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 9 | my $value = $message->trailer_value($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 9 | push @fields, _normal_field($operation, $name, $value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 95 | return \@fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 4 | ▶ | sub request_headers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request_headers: called CC=20 SCAR=34.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 4 | my ($class, $request) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 4 | ▶ | croak 'request_headers(): requires the Uniform HTTP request contract' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | unless _request_contract($request); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 4 | _check_version('request_headers()', $request); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 4 | my $method = $request->method; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 4 | my $protocol = $request->protocol; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 4 | my @block = ([ ':method', $method ]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 4 | ▶ | if (uc($method) eq 'CONNECT') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 2 | my $authority = $request->authority; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 2 | ▶ | croak 'request_headers(): CONNECT requires authority' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $authority and length $authority
MC/DC0%0/2
defined $authority and length $authority
defined $authority
length $authority
Truth table33%1/3
A and B
A= defined $authorityB= length $authority
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | unless defined($authority) && length($authority); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 2 | ▶ | if (defined $protocol) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 1 | ▶ | croak 'request_headers(): extended CONNECT requires nonempty protocol' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | unless length($protocol); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 1 | my $scheme = $request->scheme; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 1 | ▶ | croak 'request_headers(): extended CONNECT requires scheme' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $scheme and length $scheme
MC/DC0%0/2
defined $scheme and length $scheme
defined $scheme
length $scheme
Truth table33%1/3
A and B
A= defined $schemeB= length $scheme
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | unless defined($scheme) && length($scheme); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 1 | ▶ | croak 'request_headers(): extended CONNECT requires a path target' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $request->target and length $request->target
MC/DC0%0/2
defined $request->target and length $request->target
defined $request->target
length $request->target
Truth table33%1/3
A and B
A= defined $request->targetB= length $request->target
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | unless defined($request->target) && length($request->target); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 1 | push @block, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | [ ':protocol', $protocol ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | [ ':scheme', $scheme ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | [ ':authority', $authority ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | [ ':path', $request->target ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 1 | ▶ | croak 'request_headers(): ordinary CONNECT target must equal authority' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | unless $request->target eq $authority; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 1 | ▶ | croak 'request_headers(): ordinary CONNECT must not have scheme' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | if defined $request->scheme; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 1 | push @block, [ ':authority', $authority ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 2 | ▶ | croak 'request_headers(): protocol metadata requires CONNECT' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | if defined $protocol; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 2 | my $scheme = $request->scheme; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 2 | my $authority = $request->authority; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 2 | my $target = $request->target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 2 | ▶ | croak 'request_headers(): HTTP/2 Request requires nonempty path target' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $target and length $target
MC/DC0%0/2
defined $target and length $target
defined $target
length $target
Truth table33%1/3
A and B
A= defined $targetB= length $target
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | unless defined($target) && length($target); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 2 | ▶ | croak 'request_headers(): HTTP/2 Request requires scheme' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $scheme and length $scheme
MC/DC0%0/2
defined $scheme and length $scheme
defined $scheme
length $scheme
Truth table33%1/3
A and B
A= defined $schemeB= length $scheme
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | unless defined($scheme) && length($scheme); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 2 | ▶ | croak 'request_headers(): HTTP/2 Request requires authority' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $authority and length $authority
MC/DC0%0/2
defined $authority and length $authority
defined $authority
length $authority
Truth table33%1/3
A and B
A= defined $authorityB= length $authority
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | unless defined($authority) && length($authority); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 2 | push @block, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | [ ':scheme', $scheme ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | [ ':authority', $authority ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | [ ':path', $target ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 4 | push @block, @{ $class->normal_fields('request_headers()', $request) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 4 | return \@block; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | ▶ | sub response_headers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
response_headers: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | my ($class, $response) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | ▶ | croak 'response_headers(): requires the Uniform HTTP response contract' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | unless _response_contract($response); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | _check_version('response_headers()', $response); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | my @block = ([ ':status', '' . $response->status ]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | push @block, @{ $class->normal_fields('response_headers()', $response) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | return \@block; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 30 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||