diff --git a/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/index.js b/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/index.js index 688abd1383ecb..a413dd316b7e3 100644 --- a/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/index.js +++ b/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/index.js @@ -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', }); }, @@ -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, }); @@ -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, }); diff --git a/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/jobs.js b/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/jobs.js index 1ac391c7f84ae..cef2b3d2ffd7f 100644 --- a/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/jobs.js +++ b/x-pack/legacy/plugins/ml/public/application/services/ml_api_service/jobs.js @@ -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', }); },