From 7b195665e051f62940dd9e2f26df629a4667224b Mon Sep 17 00:00:00 2001 From: ading2210 Date: Wed, 10 Jul 2024 23:54:45 -0700 Subject: [PATCH] handle readablestream objects as the request payload --- client/javascript/http.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/javascript/http.js b/client/javascript/http.js index b459613..68db92d 100644 --- a/client/javascript/http.js +++ b/client/javascript/http.js @@ -149,6 +149,9 @@ class HTTPSession extends CurlSession { static async create_options(params) { let body = null; + if (params.body instanceof ReadableStream) { + params.duplex = "half"; + } let request_obj = new Request("http://127.0.0.1/", params); let array_buffer = await request_obj.arrayBuffer(); if (array_buffer.byteLength > 0) {