Skip to content

Commit

Permalink
Make sure we work with URI objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gisle Aas committed Sep 11, 1998
1 parent 2d2e61b commit 2d77b97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/WWW/RobotRules.pm
@@ -1,4 +1,4 @@
# $Id: RobotRules.pm,v 1.16.2.1 1998/09/11 12:27:19 aas Exp $
# $Id: RobotRules.pm,v 1.16.2.2 1998/09/11 12:42:04 aas Exp $

package WWW::RobotRules;

Expand Down Expand Up @@ -46,7 +46,7 @@ The following methods are provided:
=cut

$VERSION = sprintf("%d.%02d", q$Revision: 1.16.2.1 $ =~ /(\d+)\.(\d+)/);
$VERSION = sprintf("%d.%02d", q$Revision: 1.16.2.2 $ =~ /(\d+)\.(\d+)/);
sub Version { $VERSION; }

use strict;
Expand Down Expand Up @@ -82,7 +82,7 @@ retrieve the F</robots.txt> file, and the contents of the file.

sub parse {
my($self, $url, $txt, $fresh_until) = @_;
$url = URI->new($url) unless ref($url);
$url = URI->new("$url");
my $netloc = $url->authority;

$self->clear_rules($netloc);
Expand Down Expand Up @@ -174,7 +174,7 @@ Returns TRUE if this robot is allowed to retrieve this URL.

sub allowed {
my($self, $url) = @_;
$url = URI->new($url) unless ref $url; # make it URI
$url = URI->new("$url");
my $netloc = $url->authority;

my $fresh_until = $self->fresh_until($netloc);
Expand Down

0 comments on commit 2d77b97

Please sign in to comment.