[ML] Fixing analyze file endpoint call when behind proxy (#28595) (#28679)

* [ML] Fixing analyze file endpoint call when behing proxy

* small refactor
This commit is contained in:
James Gowdy 2019-01-14 15:45:54 +00:00 committed by GitHub
parent 9ceccc2d94
commit b74883907d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,14 @@ const basePath = chrome.addBasePath('/api/ml');
export const fileDatavisualizer = {
analyzeFile(obj, params) {
let paramString = '?';
for (const p in params) {
if (params.hasOwnProperty(p)) {
paramString += `&${p}=${params[p]}`;
analyzeFile(obj, params = {}) {
let paramString = '';
if (Object.keys(params).length) {
paramString = '?';
for (const p in params) {
if (params.hasOwnProperty(p)) {
paramString += `&${p}=${params[p]}`;
}
}
}
return http({