An API server may return "204 No Content" for PUT or DELETE request, but apiProxy ignores it and returns "200 OK" on the server side.
// Pass through statusCode, but not if it's an i.e. 304.
status = response.statusCode;
if (utils.isErrorStatus(status)) {
res.status(status);
}
res.json(body);
Then, on the client side, jQuery detects "parseerror" because the response has no body.
Actually, this error occurs from "304 Not Modified" too. So, I'm not sure of this comment, but workaround is here.
// Pass through statusCode, but not if it's an i.e. 304.
status = response.statusCode;
if (utils.isErrorStatus(status) || +status === 204) {
However, I believe apiProxy always should pass through status code and also end-to-end headers.
An API server may return "204 No Content" for PUT or DELETE request, but
apiProxy
ignores it and returns "200 OK" on the server side.Then, on the client side, jQuery detects "parseerror" because the response has no body. Actually, this error occurs from "304 Not Modified" too. So, I'm not sure of this comment, but workaround is here.
However, I believe
apiProxy
always should pass through status code and also end-to-end headers.