Skip to content

Commit 916e1bf

Browse files
committed
Revert "fix: Invoke cancel, only if the stream is not closed (#55684)"
This reverts commit ea01649.
1 parent ea01649 commit 916e1bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next/src/server/pipe-readable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function pipeReadable(
5858
// will also ensure the read promise rejects and frees our resources.
5959
if (!readerDone) {
6060
readerDone = true
61-
if (!reader.closed) reader.cancel().catch(() => {})
61+
reader.cancel().catch(() => {})
6262
}
6363
}
6464
writable.on('close', onClose)
@@ -88,7 +88,7 @@ export async function pipeReadable(
8888
// If we broke out of the loop because of a client disconnect, and the
8989
// close event hasn't yet fired, we can early cancel.
9090
if (!readerDone) {
91-
if (!reader.closed) reader.cancel().catch(() => {})
91+
reader.cancel().catch(() => {})
9292
}
9393

9494
// If the client hasn't disconnected yet, end the writable so that the

0 commit comments

Comments
 (0)