On 2008-12-13 23:31:11 +0100, Michal Marek wrote:
Marcus Hüwe napsal(a):
Index: BSRPC.pm =================================================================== --- BSRPC.pm (Revision 5877) +++ BSRPC.pm (Arbeitskopie) @@ -225,14 +225,20 @@ } my %headers; BSHTTP::gethead(\%headers, $headers); - if ($status !~ /^200[^\d]/) { + if ($status =~ /^200[^\d]/) { + undef $status; + } elsif ($status =~ /^302[^\d]/) { + # XXX: should we do the redirect if $param->{'ignorestatus'} is defined? + close S; + die("status 302 but no 'location' header found\n") unless exists $headers{'location'}; + $param->{'uri'} = $headers{'location'}; + return rpc($param, $xmlargs, @args);
Shouldn't there be an upper limit on the number of redirects?
Arghs - thanks for the hint. Here's the new version. Marcus