On 24 Apr 2001, Gisle Aas wrote:
> Reinier Post <[EMAIL PROTECTED]> writes:
> > I use the following local patch to LWP::RobotUA :
> > [...]
> > 234c234,235
> > < my $netloc = $request->url->host_port;
> > ---
> > > my $ru = $request->url;
> > > my $netloc = $ru->can('host_port') ? $ru->host_port : $ru->host;
>
> Not all URIs have a 'host' method either. I think simply making it:
>
> $netloc = eval { $ru->host_port };
>
> should do.
>
> But then we have the $SIG{__DIE__} stupidity which makes it:
>
> $netloc = eval { local $SIG{__DIE__}; $ru->host_port };
Should the same eval-trick be applied to the currently changed
WWW::RobotRules patch, which replaces the always defined 'authority'
method by 'host'? For me, this patch becomes a problem on broken redirect
chains (e.g. redirect to htpp://whatever). This used to return a nice
'502 Not Implemented' from the RobotUA but now it dies in RobotRules with
'Can't locate object method "host" via package "URI::_foreign"' before
RobotUA gets a chance to realize the URI is broken.
-- Thomas