Merge pull request #4300 from Icinga/preserve-show-compact-during-redirects

Automatically preserve showCompact parameter when redirecting
This commit is contained in:
Johannes Meyer 2021-01-15 16:53:28 +01:00 committed by GitHub
commit 36003df087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -287,6 +287,10 @@ class Response extends Zend_Controller_Response_Http
$redirectUrl = $this->getRedirectUrl();
if ($this->getRequest()->isXmlHttpRequest()) {
if ($redirectUrl !== null) {
if (Icinga::app()->getViewRenderer()->view->compact) {
$redirectUrl->getParams()->set('showCompact', true);
}
$this->setHeader('X-Icinga-Redirect', rawurlencode($redirectUrl->getAbsoluteUrl()), true);
if ($this->getRerenderLayout()) {
$this->setHeader('X-Icinga-Rerender-Layout', 'yes', true);