-- Andrew Ballard <[email protected]> wrote (on Wednesday, 17 March 2010, 12:13 PM -0400): > Is it possible to implement this recommendation regarding redirection: > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html > 10.3.3 302 FOUND and 10.3.4 303 SEE OTHER > > The temporary URI SHOULD be given by the Location field > in the response. Unless the request method was HEAD, the > entity of the response SHOULD contain a short hypertext > note with a hyperlink to the new URI(s). > > > It looks to me like Zend_Controller_Action_Helper_Redirector > ultimately gets to redirectAndExit() which calls > $this->getResponse()->sendHeaders(); and then exits. It doesn't appear > ANY body gets sent, so it doesn't look to me like calling > $this->getResponse()->setBody(...) in a controller before calling > $this->_helper->redirector(...) would make any difference. > > Is this something the framework should be doing itself inside > redirectAndExit()? (If so, I can't tell how that method would know the > url necessary to build the "short hypertext note", unless it parsed > though the headers looking for a Location header.) > > Since most browsers follow the redirection automatically as soon as > they see the response status code and the Location header, this isn't > a very big deal, but since it is part HTTP/1.1 standard, I was > wondering if it was possible to implement the behavior in the ZF MVC.
Please put a feature improvement in the tracker for this. There are a few other situations where it would be useful to provide body content on redirection (REST responses, for one). -- Matthew Weier O'Phinney Project Lead | [email protected] Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
