Skip to content

Commit

Permalink
[ML] Fixes handling of index pattern with special characters (#59884)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
peteharverson and elasticmachine authored Mar 11, 2020
1 parent 6645531 commit 4e83062
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const ml = {

recognizeIndex(obj) {
return http({
url: `${basePath()}/modules/recognize/${obj.indexPatternTitle}`,
url: `${basePath()}/modules/recognize/${encodeURIComponent(obj.indexPatternTitle)}`,
method: 'GET',
});
},
Expand Down Expand Up @@ -308,7 +308,9 @@ export const ml = {
]);

return http({
url: `${basePath()}/data_visualizer/get_field_stats/${obj.indexPatternTitle}`,
url: `${basePath()}/data_visualizer/get_field_stats/${encodeURIComponent(
obj.indexPatternTitle
)}`,
method: 'POST',
data,
});
Expand All @@ -326,7 +328,9 @@ export const ml = {
]);

return http({
url: `${basePath()}/data_visualizer/get_overall_stats/${obj.indexPatternTitle}`,
url: `${basePath()}/data_visualizer/get_overall_stats/${encodeURIComponent(
obj.indexPatternTitle
)}`,
method: 'POST',
data,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export const jobs = {
newJobCaps(indexPatternTitle, isRollup = false) {
const isRollupString = isRollup === true ? `?rollup=true` : '';
return http({
url: `${basePath()}/jobs/new_job_caps/${indexPatternTitle}${isRollupString}`,
url: `${basePath()}/jobs/new_job_caps/${encodeURIComponent(
indexPatternTitle
)}${isRollupString}`,
method: 'GET',
});
},
Expand Down

0 comments on commit 4e83062

Please sign in to comment.