Skip to content

Commit

Permalink
Response: Only preserve showCompact for explicit redirects
Browse files Browse the repository at this point in the history
In case of a `__SELF__` redirect, the client should still have
the parameter in the location and its preserved this way then.
  • Loading branch information
nilmerg committed Oct 26, 2023
1 parent 380a4c3 commit 220ead4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icinga/Web/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ protected function prepare()
if ($request->isXmlHttpRequest()) {
if ($redirectUrl !== null) {
if ($request->isGet() && Icinga::app()->getViewRenderer()->view->compact) {
$redirectUrl->getParams()->set('showCompact', true);
if ($redirectUrl->getParam('redirect') !== '__SELF__') {
$redirectUrl->getParams()->set('showCompact', true);
}
}

$encodedRedirectUrl = rawurlencode($redirectUrl->getAbsoluteUrl());
Expand Down

0 comments on commit 220ead4

Please sign in to comment.