Skip to content

Commit

Permalink
Decode robots.txt response content before attempting to parse it.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed May 3, 2011
1 parent 38ea477 commit 83be3c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/LWP/RobotUA.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ sub simple_request
my $robot_res = $self->request($robot_req);
my $fresh_until = $robot_res->fresh_until;
if ($robot_res->is_success && $robot_res->content_is_text) {
my $c = $robot_res->content;
if ($c =~ /^\s*Disallow\s*:/mi) {
my $c = $robot_res->decoded_content;
if ($c && $c =~ /^\s*Disallow\s*:/mi) {
$self->{'rules'}->parse($robot_url, $c, $fresh_until);
}
else {
Expand Down

0 comments on commit 83be3c5

Please sign in to comment.