|We don't bite newbies here... much|
Re: make useragent follow redirects in post actionsby arhuman (Vicar)
|on Feb 21, 2001 at 14:43 UTC||Need Help??|
To answer to your question the RFC2616 says:
If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Note: When automatically redirecting a POST request after receiving a 301 status code, some existing HTTP/1.0 user agents will erroneously change it into a GET request.
For yor other question : You can make a new MyUa.pm redefining only redirect_ok (or modified UserAgent.pm, but it's dirty) to follow your rules.
At the office we have configured 3 different behaviour for redirect on POST :
Strict RFC compliance->don't follow to new location.
'Rfc erroneous' mode->follow to new location but with a get (as the RFC say you shouldn't POST automatically to the new location.
Weird mode(but usefull)-> where we POST to the new location.
I must precise that ALL these modes are needed as we found, in real life, sites that needs one of these modes...