[Zope3-dev] Redirects

Adrian van den Dries az@CANTANKER.NET
Sun, 26 Jan 2003 10:57:04 +1100


I just want to raise a small niggle I have about an idiom I always see
in Zope development (and in web development in general) -- redirects
after POSTs.

RFC 2068, section 10.3.2 states:

  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.

Ditto 302.

Note that most browsers are in violation of this specification and are
happy to redirect you, but that is not an excuse to do this.

I would propose that instead of ``response.redirect(...)`` you instead
return the content of the object you want to redirect to.  This would
be more correct.

a.

-- 
Cantanker /
---------/-------------
        / cantanker.net