From 6421dc33ede06fb429000c3a560214cdaf573673 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 16 Jul 2024 17:46:40 +0530 Subject: fix(ext/node): http request uploads of subarray of buffer should work (#24603) Closes https://github.com/denoland/deno/issues/24571 --- ext/node/polyfills/_http_outgoing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/node') diff --git a/ext/node/polyfills/_http_outgoing.ts b/ext/node/polyfills/_http_outgoing.ts index 35526a303..a6edc1144 100644 --- a/ext/node/polyfills/_http_outgoing.ts +++ b/ext/node/polyfills/_http_outgoing.ts @@ -540,7 +540,7 @@ export class OutgoingMessage extends Stream { data = Buffer.from(data, encoding); } if (data instanceof Buffer) { - data = new Uint8Array(data.buffer); + data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength); } if (data.buffer.byteLength > 0) { this._bodyWriter.write(data).then(() => { -- cgit v1.2.3