From 46d5f38a0f839db34ecce67f3483469e82cb593d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 12 Sep 2024 03:03:57 +0100 Subject: [PATCH] fix(ext/node): export request and response clases from `http2` module (#25592) Closes https://github.com/denoland/deno/issues/20612 Closes https://github.com/denoland/deno/issues/23326 This makes `qwik` work. --- ext/node/polyfills/http2.ts | 4 ++-- tests/unit_node/http2_test.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/node/polyfills/http2.ts b/ext/node/polyfills/http2.ts index cab7aa26c0665f..a9ced2bd9e9261 100644 --- a/ext/node/polyfills/http2.ts +++ b/ext/node/polyfills/http2.ts @@ -2295,7 +2295,7 @@ function onStreamTimeout(kind) { }; } -class Http2ServerRequest extends Readable { +export class Http2ServerRequest extends Readable { readableEnded = false; constructor(stream, headers, options, rawHeaders) { @@ -2523,7 +2523,7 @@ function isConnectionHeaderAllowed(name, value) { value === "trailers"; } -class Http2ServerResponse extends Stream { +export class Http2ServerResponse extends Stream { writable = false; req = null; diff --git a/tests/unit_node/http2_test.ts b/tests/unit_node/http2_test.ts index 1dfac8f8c34316..cb939646be2524 100644 --- a/tests/unit_node/http2_test.ts +++ b/tests/unit_node/http2_test.ts @@ -378,3 +378,8 @@ Deno.test("[node/http2 client] connection states", async () => { assertEquals(actual, expected); }); + +Deno.test("request and response exports", () => { + assert(http2.Http2ServerRequest); + assert(http2.Http2ServerResponse); +});