Skip to content

Commit 01710c0

Browse files
committed
fix: fix issue #15
1 parent 0d918ab commit 01710c0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/interceptor/node/client-request.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,14 @@ function ClientRequest(
7272
this.socket.setTimeout(options.timeout);
7373
}
7474

75-
process.nextTick(() => {
76-
this.emit('socket', this.socket);
77-
this.socket?.emit('connect');
78-
});
79-
8075
if (options.headers?.expect === '100-continue') {
8176
this.emit('continue');
8277
}
8378

8479
this.response = new http.IncomingMessage(this.socket);
80+
81+
this.emit('socket', this.socket);
82+
this.socket?.emit('connect');
8583
};
8684
this.init();
8785

0 commit comments

Comments
 (0)