From 818f7cb89295ff04cf69ef67b25207ec7b7e7e4f Mon Sep 17 00:00:00 2001 From: Fred Moyer Date: Mon, 13 Jun 2016 12:00:42 -0700 Subject: [PATCH] fix content-type error where $h is a ref but not an array --- Changes | 2 ++ lib/HTTP/Headers.pm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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) {