express-interceptor icon indicating copy to clipboard operation
express-interceptor copied to clipboard

On response header, Transfer-Encoding is always chunked

Open djaoka opened this issue 6 years ago • 2 comments

It's seems that if i use this package, Content-Length is never set and Transfer-Encoding is equal to chunked. Is it normal ?

My fix : setting the Content-Length juste before calling send

const data = JSON.parse(body);

data.moreInfo = 'tada!';

....

res.set('Content-Length', Buffer.byteLength(JSON.stringify(data), 'utf-8'));

send(JSON.stringify(data));

djaoka avatar Nov 01 '18 09:11 djaoka

Hi Johann, if there is something you'd like to PR we can consider the change, but we are not active in this project for the past years.

flockonus avatar Nov 02 '18 17:11 flockonus

ok i will try to PR. thx

djaoka avatar Nov 07 '18 21:11 djaoka