Redirects // Re: [Catalyst] Re: forwarding to chained actions
jjn1056 at yahoo.com
Fri Apr 27 17:20:07 GMT 2007
----- Original Message ----
From: Simon Wilcox <simonw at digitalcraftsmen.net>
To: The elegant MVC web framework <catalyst at lists.rawmode.org>
Sent: Friday, April 27, 2007 9:03:23 AM
Subject: Redirects // Re: [Catalyst] Re: forwarding to chained actions
On Tue, 24 Apr 2007, A. Pagaltzis wrote:
> _ALL_ POSTs should be followed by a redirect, ALWAYS.
This is really good advice but I was looking at the response code RFC
today  for an unrelated matter and found the following:
If the 302 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.
It then goes on to say:
Note: RFC 1945 and RFC 2068 specify that the client is not allowed to
change the method on the redirected request. However, most existing
user agent implementations treat 302 as if it were a 303 response,
performing a GET on the Location field-value regardless of the original
request method. The status codes 303 and 307 have been added for servers
that wish to make unambiguously clear which kind of reaction is expected
of the client.
So, what do people do - do you send 303/307's "correctly" or just default
to 302 behaviour ?
I do a 303 for when a post alters the system, such as when I add a new record to a CRUD style
interface and want to redirect back to the list view. I use 302 when the post is merely sending me someplace after some processing, like after I successful login I redirect back to the requested page or to a default.
Digital Craftsmen Ltd
Exmouth House, 3 Pine Street, London. EC1R 0JH
t 020 7183 1410 f 020 7099 5140 m 07951 758698
List: Catalyst at lists.rawmode.org
Searchable archive: http://email@example.com/
Dev site: http://dev.catalyst.perl.org/
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Catalyst