Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 2304
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: nkiesel [...] tbdnetworks.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.38
Fixed in: (no value)



Subject: follow Location header if status == 302
I'm hitting a web server (Tomcat4/Jboss) which sometimes sends back a "Page moved temporarily" (302) page and the new location in the Location header field. It would be cool if this case would result in automatically running a $agent->get($agent->res->header('Location')).
This should be fixed in 0.43.
From: nk [...] iname.com
[PETDANCE - Thu May 29 10:39:49 2003]: Show quoted text
> This should be fixed in 0.43.
Hmm, justtried 0.43 but my problem is still there. Perhaps I'm doing something wrong? My problem is that I occasionally get a HTTP response with status 302 and Location pointing to the new URL. So what I currently do is to run "$m->get($m->res->header('Location')) while $m->status == 302;" after each submit() or follow_link(). What I was hoping for was that this check would be done automatically in submit() etc. Thanks anyway for a great piece of code. Norbert
Date: Sun, 1 Jun 2003 21:32:02 -0500
Subject: Re: [cpan #2304] follow Location header if status == 302
From: Andy Lester <andy [...] petdance.com>
To: bug-WWW-Mechanize [...] rt.cpan.org
RT-Send-Cc:
Show quoted text
> Hmm, justtried 0.43 but my problem is still there. Perhaps I'm doing > something wrong? My problem is that I occasionally get a HTTP response > with status 302 and Location pointing to the new URL. So what I > currently do is to run "$m->get($m->res->header('Location')) while > $m->status == 302;" after each submit() or follow_link(). What I was > hoping for was that this check would be done automatically in submit() > etc.
submit() and follow_link() should indeed follow the redirects for you now. xoxo, Andy -- Andy Lester andy@petdance.com, AIM:petdance http://petdance.com/ http://use.perl.org/~petdance/
OK, now it'll all be good. Mech didn't used to follow a 302 after a POST. It would only follow on GET and HEAD. Now it'll follow on all three. this is in v0.44 that I changed it.