Skip to content

Commit 84f86ba

Browse files
committed
chore: added abort logic
1 parent dded691 commit 84f86ba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/node-http-handler/src/node-http2-handler.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,15 @@ export class NodeHttp2Handler
7777
reject(timeoutError);
7878
});
7979
}
80-
// TODO: wire-up any abort logic
80+
81+
if (abortSignal) {
82+
abortSignal.onabort = () => {
83+
req.close();
84+
const abortError = new Error("Request aborted");
85+
abortError.name = "AbortError";
86+
reject(abortError);
87+
};
88+
}
8189

8290
writeRequestBody(req, request);
8391
});

0 commit comments

Comments
 (0)