diff --git a/Makefile.PL b/Makefile.PL
index 6f575f7..9bf0947 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -12,6 +12,7 @@ WriteMakefile(
PREREQ_PM => {
'Encode' => 2.00,
'Test::More' => 0,
+ 'HTTP::Message' => 5.827,
'HTTP::Response' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
diff --git a/lib/HTTP/Response/Encoding.pm b/lib/HTTP/Response/Encoding.pm
index 768aeed..95375e5 100644
--- a/lib/HTTP/Response/Encoding.pm
+++ b/lib/HTTP/Response/Encoding.pm
@@ -5,11 +5,7 @@ our $VERSION = sprintf "%d.%02d", q$Revision: 0.5 $ =~ /(\d+)/g;
sub HTTP::Response::charset {
my $self = shift;
- return $self->{__charset} if exists $self->{__charset};
- my $content_type = $self->headers->header('Content-Type');
- return unless $content_type;
- $content_type =~ /charset=([A-Za-z0-9_\-]+)/io;
- $self->{__charset} = $1 || undef;
+ return $self->content_charset;
}
sub HTTP::Response::encoder {
diff --git a/t/01-file.t b/t/01-file.t
index 7203847..8eda2ea 100644
--- a/t/01-file.t
+++ b/t/01-file.t
@@ -55,4 +55,4 @@ my $uri = URI->new('file://');
$uri->path(File::Spec->catfile($cwd, "t", "t-null.html"));
my $res = $ua->get($uri);
die unless $res->is_success;
-is $res->encoding, undef, "res->encoding eq undef";
+is $res->encoding, "ascii", "res->encoding is ascii";