From 3dd239c019cfe9e40a9d63f201136a8a9220e116 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Wed, 23 Oct 2024 13:01:42 +0100 Subject: [PATCH] Update Router.ts --- packages/core/src/Router.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/Router.ts b/packages/core/src/Router.ts index 24e6d8d6..e6f36165 100644 --- a/packages/core/src/Router.ts +++ b/packages/core/src/Router.ts @@ -166,7 +166,11 @@ export default class Router { const requestBody = request?.body || options?.body; if (requestBody instanceof ReadableStream) { - requestBody.cancel(error); + if (requestBody.locked) { + requestBody.getReader().cancel(error); + } else { + requestBody.cancel(error); + } } if (callLog?.response?.body) {