Skip to content

Commit

Permalink
[chrome/urlOverflowCheck] use modifyUrl helper (#22435) (#22477)
Browse files Browse the repository at this point in the history
Fixes #18835

This updates the url-overflow redirect to use the `modifyUrl()` helper which was written almost exclusively to help deal with the confusion that node's `path` and `pathname` nonsense creates. I tested this in Edge and things seem to work well, but I'd appreciate if @baracudda or @chandanpal could checkout this PR and see if it works for them.
  • Loading branch information
Spencer committed Aug 29, 2018
1 parent b980f6e commit ae8cbe3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ui/public/chrome/api/angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import React, { Fragment } from 'react';
import _ from 'lodash';
import { format as formatUrl, parse as parseUrl } from 'url';
import { modifyUrl } from 'ui/url';

import { uiModules } from '../../modules';
import { toastNotifications } from '../../notify';
Expand Down Expand Up @@ -97,10 +97,11 @@ export function initAngularApi(chrome, internals) {
});
}
} catch (e) {
const { host, path, search, protocol } = parseUrl(window.location.href);
// rewrite the entire url to force the browser to reload and
// discard any potentially unstable state from before
window.location.href = formatUrl({ host, path, search, protocol, hash: '#/error/url-overflow' });
window.location.href = modifyUrl(window.location.href, parts => {
parts.hash = '#/error/url-overflow';
});
// force the browser to reload to that Kibana's potentially unstable state is unloaded
window.location.reload();
}
};

Expand Down

1 comment on commit ae8cbe3

@wheelq
Copy link

@wheelq wheelq commented on ae8cbe3 Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still shows url-overflow under iexplorer11

Please sign in to comment.