diff --git a/Changes b/Changes index 1640fc91..d0787c32 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for HTTP-Message + - fix error where content-type header is ref but not an array + 6.11 2015-09-09 - fix an undefined value warning in HTTP::Headers::as_string diff --git a/lib/HTTP/Headers.pm b/lib/HTTP/Headers.pm index 281d2b8d..b4a8f06d 100644 --- a/lib/HTTP/Headers.pm +++ b/lib/HTTP/Headers.pm @@ -359,7 +359,7 @@ sub content_type_charset { my $self = shift; require HTTP::Headers::Util; my $h = $self->{'content-type'}; - $h = $h->[0] if ref($h); + $h = $h->[0] if ref($h) eq 'ARRAY'; $h = "" unless defined $h; my @v = HTTP::Headers::Util::split_header_words($h); if (@v) {