Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected

by Anonymous Monk
on Mar 13, 2018 at 20:21 UTC ( #1210844=note: print w/replies, xml ) Need Help??


in reply to LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected

That actually looks like a bug to me. The test should be "is greater than," not "is greater than or equal." I would open a problem-report to that effect. I think that what you have said should be understood to mean that redirects ought not be followed. But, really, there ought to be a follow_redirects (true/false) option to settle the matter. Meanwhile, I wonder what would happen if you set requests_redirectable to an empty array?
  • Comment on Re: LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected

Replies are listed 'Best First'.
Re^2: LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected
by ikegami (Pope) on Mar 14, 2018 at 03:04 UTC

    Not quite. It should be >=, but it should only check if the last response in the chain was a redirect.

Re^2: LWP::UserAgent : setting max_redirect to 0 yields 'Client-Warning: Redirect loop detected
by bliako (Vicar) on Mar 13, 2018 at 21:12 UTC

    Thanks for your reply,

    I did both at the same time: set requests_redirectable to an empty array AND max_redirect to zero. (see the code in my first post). But I also report in another comment here how your suggestion works. And I agree with you that this is probably a bug. That '>=' should be '>' really.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1210844]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2019-12-06 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?