We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a3a30d commit 1b4267aCopy full SHA for 1b4267a
lib/WWW/Mechanize.pm
@@ -868,7 +868,8 @@ sub content {
868
869
my $content = $self->{content};
870
if ( delete $params{raw} ) {
871
- $content = $self->response()->content();
+ my $res = $self->response();
872
+ $content = $res->content() if $res;
873
}
874
elsif ( delete $params{decoded_by_headers} ) {
875
$content = $self->response()->decoded_content( charset => 'none' );
t/content.t
@@ -37,6 +37,7 @@ my $mech = WWW::Mechanize->new();
37
$mech->{base} = 'http://example.com/';
38
39
is( $mech->content, undef, 'content starts out as undef' );
40
+is( $mech->content(raw=>1), undef, 'raw content is just as undef as normal' );
41
42
$mech->update_html($html);
43
0 commit comments