summaryrefslogtreecommitdiff
path: root/ext/node/polyfills
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-06-15 15:34:21 +0200
committerGitHub <noreply@github.com>2023-06-15 15:34:21 +0200
commitf145cbfaccd9f3b251b2f80690ad7c68b26d924b (patch)
treef546388ed6b1d3ce28400a5e32d85a75efcfd3a5 /ext/node/polyfills
parent3d71c36888018d5154b42997bb64adc2892c034d (diff)
refactor(ext/fetch): simplify fetch ops (#19494)
Addresses feedback from https://github.com/denoland/deno/pull/19412#discussion_r1227912676
Diffstat (limited to 'ext/node/polyfills')
-rw-r--r--ext/node/polyfills/http.ts13
1 files changed, 2 insertions, 11 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 0529ccca5..a07a2c91d 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -595,13 +595,7 @@ class ClientRequest extends OutgoingMessage {
(async () => {
try {
const [res, _] = await Promise.all([
- core.opAsync(
- "op_fetch_send",
- this._req.requestRid,
- /* false because we want to have access to actual Response,
- not the bytes stream of response (because we need to handle upgrades) */
- false,
- ),
+ core.opAsync("op_fetch_send", this._req.requestRid),
(async () => {
if (this._bodyWriteRid) {
try {
@@ -700,10 +694,7 @@ class ClientRequest extends OutgoingMessage {
this.emit("close");
} else {
{
- const responseRid = core.ops.op_fetch_response_into_byte_stream(
- res.responseRid,
- );
- incoming._bodyRid = responseRid;
+ incoming._bodyRid = res.responseRid;
}
this.emit("response", incoming);
}