Sisters and Brothers,
I am trying to tell LWP::UserAgent (UA) not to follow any redirect (for example, a server response of '302 Found').
I would like UA to simply make a request and then just to return the HTTP::Response back to me.
So, I create UA as thus:
my $ua = LWP::UserAgent->new( 'requests_redirectable' => [], 'max_redirect' => 0, );
With the above, I can see in my logs that indeed UA does not follow the redirect but now I get a warning:
Client-Warning: Redirect loop detected (max_redirect = 0)
which is produced in this check in LWP::UserAgent.pm (sub request):
if ($response->redirects >= $self->{max_redirect}) { $response->header("Client-Warning" => "Redirect loop detected (max_redirect = $self->{max_re +direct})" ); return $response; }
The redirect count is zero, the max_redirects is zero but that does not mean a redirect loop has been detected.
Or am I confused (just in this particular issue)?
thanks,
b
In reply to LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |