Skip to content

Commit e6254f1

Browse files
authored
[Discover] Encode context link filter part (#63831)
* Encode filter part of the URI for context * Add functional test agent filter with whitespace
1 parent 9a13779 commit e6254f1

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/plugins/discover/public/application/angular/doc_table/components/table_row.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,17 @@ export function createTableRowDirective($compile: ng.ICompileService, $httpParam
112112
const globalFilters: any = getServices().filterManager.getGlobalFilters();
113113
const appFilters: any = getServices().filterManager.getAppFilters();
114114
const hash = $httpParamSerializer({
115-
_g: rison.encode({
116-
filters: globalFilters || [],
117-
}),
118-
_a: rison.encode({
119-
columns: $scope.columns,
120-
filters: (appFilters || []).map(esFilters.disableFilter),
121-
}),
115+
_g: encodeURI(
116+
rison.encode({
117+
filters: globalFilters || [],
118+
})
119+
),
120+
_a: encodeURI(
121+
rison.encode({
122+
columns: $scope.columns,
123+
filters: (appFilters || []).map(esFilters.disableFilter),
124+
})
125+
),
122126
});
123127

124128
return `${path}?${hash}`;

test/functional/apps/context/_context_navigation.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const TEST_COLUMN_NAMES = ['@message'];
2323
const TEST_FILTER_COLUMN_NAMES = [
2424
['extension', 'jpg'],
2525
['geo.src', 'IN'],
26+
[
27+
'agent',
28+
'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24',
29+
],
2630
];
2731

2832
export default function({ getService, getPageObjects }) {
@@ -56,7 +60,7 @@ export default function({ getService, getPageObjects }) {
5660
await browser.goBack();
5761
await PageObjects.discover.waitForDocTableLoadingComplete();
5862
const hitCount = await PageObjects.discover.getHitCount();
59-
expect(hitCount).to.be('1,556');
63+
expect(hitCount).to.be('522');
6064
});
6165
});
6266
}

0 commit comments

Comments
 (0)