Merge pull request #6517 from stormpython/issue/6516

Rectifies kbn-href query string not being appended
This commit is contained in:
Spencer 2016-03-15 16:47:52 -07:00
commit 4f3d450012
2 changed files with 6 additions and 1 deletions

View file

@ -36,5 +36,10 @@ describe('chrome nav apis', function () {
const chrome = getChrome();
expect(chrome.addBasePath('http://github.com/elastic/kibana')).to.be('http://github.com/elastic/kibana');
});
it('includes the query string', function () {
const chrome = getChrome();
expect(chrome.addBasePath('/app/kibana?a=b')).to.be(`${basePath}/app/kibana?a=b`);
});
});
});

View file

@ -18,7 +18,7 @@ export default function (chrome, internals) {
var isUrl = url && isString(url);
if (!isUrl) return url;
var parsed = parse(url);
var parsed = parse(url, true);
if (!parsed.host && parsed.pathname) {
if (parsed.pathname[0] === '/') {
parsed.pathname = chrome.getBasePath() + parsed.pathname;