Merge pull request #290 from alibaba/write-after-end

fix the "write after end" error when in stream mode
This commit is contained in:
Otto Mao
2017-12-13 00:07:29 +08:00
committed by GitHub

View File

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