diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index f5fded73d..680205902 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -424,6 +424,10 @@ class ActionController extends Zend_Controller_Action protected function redirectHttp($url) { + if ($this->isXhr()) { + $this->getResponse()->setHeader('X-Icinga-Redirect-Http', 'yes'); + } + $this->getResponse()->redirectAndExit($url); } diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index d17465e09..a52ba9b56 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -343,6 +343,12 @@ } } + var useHttp = req.getResponseHeader('X-Icinga-Redirect-Http'); + if (useHttp === 'yes') { + window.location.replace(redirect); + return true; + } + this.redirectToUrl( redirect, req.$target, req.url, req.getResponseHeader('X-Icinga-Rerender-Layout'), req.forceFocus, req.getResponseHeader('X-Icinga-Refresh')