Skip to content

Commit 40105be

Browse files
committed
fix(web-incoming): destroy request socket on timeout
1 parent c9d2c51 commit 40105be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/middleware/web-incoming.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export const deleteLength = defineProxyMiddleware((req) => {
2323
*/
2424
export const timeout = defineProxyMiddleware((req, res, options) => {
2525
if (options.timeout) {
26-
req.socket.setTimeout(options.timeout);
26+
req.socket.setTimeout(options.timeout, () => {
27+
req.socket.destroy();
28+
});
2729
}
2830
});
2931

0 commit comments

Comments
 (0)