adding console proxy comments (#35971) (#36021)

This commit is contained in:
Bill McConaghy 2019-05-03 08:37:25 -04:00 committed by GitHub
parent b353cdd90b
commit d17e1eaa2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,9 @@ function resolveUri(base, path) {
} else {
// pathToUse has query string, append '&pretty'
pathToUse = `${pathToUse}&pretty`;
}
} // appending pretty here to have Elasticsearch do the JSON formatting, as doing
// in JS can lead to data loss (7.0 will get munged into 7, thus losing indication of
// measurement precision)
return pathToUse;
}
@ -132,6 +134,8 @@ export const createProxyRoute = ({
.type('text/plain')
.header('warning', esResponse.headers.warning);
};
// Wreck assumes that DELETE requests will not have a body, and thus it does not
// parse the payload to pass it along, so we have to do this manually here.
if (method.toUpperCase() === 'DELETE') {
const data = await Wreck.read(payload);
return await makeRequest(data);