fix the "write after end" error when in stream mode

This commit is contained in:
砚然 2017-12-11 10:24:21 +08:00
parent e54fb23daa
commit 7b3d171a96

View File

@ -159,7 +159,7 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
res.on('end', () => { res.on('end', () => {
if (resDataStream) { if (resDataStream) {
resDataStream.emit('end'); // EOF resDataStream.push(null); // indicate the stream is end
} else { } else {
finishCollecting(); finishCollecting();
} }