backend curl: header case insensitive

This commit is contained in:
garnier-quentin 2019-03-13 09:21:48 +01:00
parent 721543f96c
commit 749eef09ff

View File

@ -251,7 +251,7 @@ sub parse_headers {
if (!defined($self->{response_headers_parse}->{$header}));
push @{$self->{response_headers_parse}->{$header}}, $value;
}
$header = $1;
$header = lc($1);
$value = $2;
} elsif (/^\s+(.*)/) {
$value .= ', ' . $1;
@ -388,8 +388,8 @@ sub get_header {
my ($self, %options) = @_;
return undef
if (!defined($self->{response_headers_parse}->{$options{name}}));
return wantarray ? @{$self->{response_headers_parse}->{$options{name}}} : $self->{response_headers_parse}->{$options{name}}->[0];
if (!defined($self->{response_headers_parse}->{ lc($options{name}) }));
return wantarray ? @{$self->{response_headers_parse}->{ lc($options{name}) }} : $self->{response_headers_parse}->{ lc($options{name}) }->[0];
}
sub get_code {