From 3f00a486820b448b75707f8464fe83cfb03d5117 Mon Sep 17 00:00:00 2001 From: Ali Yusuf <17704100+AliYusuf95@users.noreply.github.com> Date: Sat, 18 Jun 2022 14:07:27 +0300 Subject: [PATCH] fix(next): bind new stream functions with base incomingMessage object Closes: #37805 --- packages/next/server/body-streams.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/server/body-streams.ts b/packages/next/server/body-streams.ts index 19a3c20c004b9..6e04e3c771eed 100644 --- a/packages/next/server/body-streams.ts +++ b/packages/next/server/body-streams.ts @@ -41,7 +41,7 @@ function replaceRequestBody( for (const key in stream) { let v = stream[key as keyof Readable] as any if (typeof v === 'function') { - v = v.bind(stream) + v = v.bind(base) } base[key as keyof T] = v }