Closed
Description
Version: Deno 2.1.1
Example:
Deno.serve((req: Request) => {
req.signal.addEventListener("abort", () => {
console.log("Request aborted on the server side:", req.signal.aborted);
});
return new Response("Hello, World!");
});
const constructor = new AbortController();
const { signal } = constructor;
const res = await fetch("http://localhost:8000", { signal });
console.log(await res.text());
console.log("Request aborted on the client side:", signal.aborted);
Prints:
Request aborted on the server side: true
Hello, World!
Request aborted on the client side: false
This is awkward, and may even lead to potential bugs.
Bun doesn't seem to have this problem.