ActionController: Ensure to utilize the response to redirect and exit

This commit is contained in:
Johannes Meyer 2017-06-19 09:11:12 +02:00
parent df04c0f837
commit 8ee6e763a6

View File

@ -415,33 +415,15 @@ class ActionController extends Zend_Controller_Action
protected function redirectXhr($url) protected function redirectXhr($url)
{ {
if (! $url instanceof Url) {
$url = Url::fromPath($url);
}
if ($this->rerenderLayout) {
$this->getResponse()->setHeader('X-Icinga-Rerender-Layout', 'yes');
}
if ($this->reloadCss) {
$this->getResponse()->setHeader('X-Icinga-Reload-Css', 'now');
}
$this->shutdownSession();
$this->getResponse() $this->getResponse()
->setHeader('X-Icinga-Redirect', rawurlencode($url->getAbsoluteUrl())) ->setReloadCss($this->reloadCss)
->sendHeaders(); ->setRerenderLayout($this->rerenderLayout)
->redirectAndExit($url);
exit;
} }
protected function redirectHttp($url) protected function redirectHttp($url)
{ {
if (! $url instanceof Url) { $this->getResponse()->redirectAndExit($url);
$url = Url::fromPath($url);
}
$this->shutdownSession();
$this->_helper->Redirector->gotoUrlAndExit($url->getRelativeUrl());
} }
/** /**