Skip to content

Commit 7b3d171

Browse files
committed
fix the "write after end" error when in stream mode
1 parent e54fb23 commit 7b3d171

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/requestHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function fetchRemoteResponse(protocol, options, reqData, config) {
159159

160160
res.on('end', () => {
161161
if (resDataStream) {
162-
resDataStream.emit('end'); // EOF
162+
resDataStream.push(null); // indicate the stream is end
163163
} else {
164164
finishCollecting();
165165
}

0 commit comments

Comments
 (0)