Skip to content

Commit a24fa49

Browse files
author
Tera
authored
Update web.incoming.ts
1 parent 25e32b3 commit a24fa49

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/proxy/passes/web.incoming.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,8 @@ export function stream(req: IncomingMessage, res: ServerResponse, options: Serve
131131
}
132132

133133
// Ensure we abort proxy if request is aborted
134-
req.on('close', function () {
135-
if (req.destroyed) {
136-
proxyReq.destroy();
137-
}
138-
});
139-
140134
res.on('close', function () {
141-
if (!res.writableFinished) {
135+
if (req.destroyed || !res.writableFinished) {
142136
proxyReq.destroy();
143137
}
144138
});

0 commit comments

Comments
 (0)