From c27ef0ac7b5fd7aba4de24292e80387c8243896e Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Tue, 26 Oct 2021 22:00:01 +0200 Subject: perf(http): encode string bodies in op-layer (#12451) Using serde_v8's StringOrBuffer --- ext/fetch/26_fetch.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/fetch/26_fetch.js') diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index fcfa75318..b9e2b1e6b 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -214,6 +214,8 @@ } else { req.body.streamOrStatic.consumed = true; reqBody = req.body.streamOrStatic.body; + // TODO(@AaronO): plumb support for StringOrBuffer all the way + reqBody = typeof reqBody === "string" ? core.encode(reqBody) : reqBody; } } -- cgit v1.2.3