Response break if write more "text" / "attributes" to the body
Thanks for creating this package.
We have problem that the json response got cut off when you put in more than one attributes. ( might be because of content length ) ?
It is working when you add one value, but seems like it is broken when you add more than one value
If one value as in example
modifyResponse(res, proxyRes.headers['content-encoding'], function (body) {
if (body) {
// modify some information
body.version = 2;
}
return body;
});
Result --> It return as an full JSON

If more than one value
modifyResponse(res, proxyRes.headers['content-encoding'], function (body) {
if (body) {
// modify some information
// just adding one more attribute here below
body.version = 2;
body.age = 2;
}
return body;
});
Result --> It actually cut off, NOT a valid JSON

Ok, just answering my question, delete the content length will work ...
delete proxyRes.headers['content-length'];
Well it works but deleting the Content-Length header will switch the response to
Transfer-Encoding: chunked mode.
It's useful for dynamic content (streaming something for example) but a solution with the Content-Length header would be better.
the same issue here - after modifying the response it fails... content-length header is not changing when the response is changed - this is the problem... could you please fix it or tell how to overcome the issue?