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
commit 87c4eeec94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
} }