Skip to content

Commit

Permalink
Fix: Scheme and hostname prepended to col2 url in the address bar (#4777
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 707775f)
  • Loading branch information
sukhwinder33445 authored and nilmerg committed Jun 15, 2022
1 parent f359a64 commit a90f4ba
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions public/js/icinga/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,9 @@
}

var autoSubmit = false;
var currentUrl = this.icinga.utils.parseUrl(req.$target.data('icingaUrl'));
if (referrer.method === 'POST') {
var newUrl = this.icinga.utils.parseUrl(req.url);
var currentUrl = this.icinga.utils.parseUrl(req.$target.data('icingaUrl'));
if (newUrl.path === currentUrl.path && this.icinga.utils.arraysEqual(newUrl.params, currentUrl.params)) {
autoSubmit = true;
}
Expand All @@ -828,9 +828,7 @@
if (!! contentSeparator) {
var locationQuery = req.getResponseHeader('X-Icinga-Location-Query');
if (locationQuery !== null) {
var a = this.icinga.utils.getUrlHelper().cloneNode(true);
a.search = locationQuery ? '?' + locationQuery : '';

let url = currentUrl.path + (locationQuery ? '?' + locationQuery : '');
if (req.autosubmit || autoSubmit) {
// Also update a form's action if it doesn't differ from the container's url
var $form = $(referrer.forceFocus).closest('form');
Expand All @@ -840,12 +838,12 @@
if (formAction.path === currentUrl.path
&& this.icinga.utils.arraysEqual(formAction.params, currentUrl.params)
) {
$form.attr('action', a.href);
$form.attr('action', url);
}
}
}

req.$target.data('icingaUrl', a.href);
req.$target.data('icingaUrl', url);
this.icinga.history.replaceCurrentState();
}

Expand Down

0 comments on commit a90f4ba

Please sign in to comment.