Merge pull request #3503 from Icinga/fix/let-redirect-http-use-http-for-redirection

This commit is contained in:
Johannes Meyer 2018-07-04 15:57:39 +02:00 committed by GitHub
commit 2a48bd0f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -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);
}

View File

@ -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')