Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 40260
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: ilvin [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 5.819
Fixed in: (no value)



Subject: max_redirect=>0 don`t work!
max_redirect=>0 don`t work! Always sending one redirected request :( Bug in function request: sub request { my($self, $request, $arg, $size, $previous) = @_; LWP::Debug::trace('()'); vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv my $response = $self->simple_request($request, $arg, $size); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Where checking variable $self->{max_redirect} ? ------------------------------------------------------------------ if ($previous) { $response->previous($previous); # Check for loop in the redirects, we only count my $count = 0; my $r = $response; while ($r) { if (++$count > $self->{max_redirect}) { $response->header("Client-Warning" => "Redirect loop detected (max_redirect = $self->{max_redirect})"); return $response; } $r = $r->previous; } Hint: requests_redirectable=>[] It`s work.
Very Critical!!! simple_request also works, but is not the solution, many old scripts are currently broken! On Mi. 22. Okt. 2008, 06:05:32, IlVin wrote: Show quoted text
> max_redirect=>0 don`t work! > Always sending one redirected request :( > > Bug in function request: > > sub request > { > my($self, $request, $arg, $size, $previous) = @_; > > LWP::Debug::trace('()'); > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > my $response = $self->simple_request($request, $arg, $size); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Where checking variable $self->{max_redirect} ? > ------------------------------------------------------------------ > > if ($previous) { > $response->previous($previous); > > # Check for loop in the redirects, we only count > my $count = 0; > my $r = $response; > while ($r) { > if (++$count > $self->{max_redirect}) { > $response->header("Client-Warning" => > "Redirect loop detected (max_redirect =
$self->{max_redirect})"); Show quoted text
> return $response; > } > $r = $r->previous; > } > > > Hint: requests_redirectable=>[] > It`s work.
I've fixed it now. http://gitorious.org/projects/libwww- perl/repos/mainline/commits/7f540e237d406192f6ee5c7d8dbdbb1b61266b12