diff options
author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2023-03-27 16:25:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 14:25:17 +0000 |
commit | 357bcfcf79fee92195e37bb3f05e247908f207c5 (patch) | |
tree | 0eddf89fc6b0971498bf56586a35bffa9a103efb /ext/node/polyfills/http.ts | |
parent | 2b389ecf62f296712f0a3da488451ba6f19b43f7 (diff) |
Revert "refactor: remove Deno[Deno.internal].nodeUnstable namespace (… (#18458)
…#18449)"
This reverts commit d1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d.
Appears this made CI very flaky on macOS, but I can't repeat it locally
yet
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r-- | ext/node/polyfills/http.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index b99e7afab..87b19972f 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1,7 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -const core = globalThis.Deno.core; -const ops = core.ops; import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; import { type Deferred, deferred } from "ext:deno_node/_util/async.ts"; import { _normalizeArgs, ListenOptions, Socket } from "ext:deno_node/net.ts"; @@ -19,7 +17,6 @@ import { Agent } from "ext:deno_node/_http_agent.mjs"; import { chunkExpression as RE_TE_CHUNKED } from "ext:deno_node/_http_common.ts"; import { urlToHttpOptions } from "ext:deno_node/internal/url.ts"; import { constants, TCP } from "ext:deno_node/internal_binding/tcp_wrap.ts"; -import * as flash from "ext:deno_flash/01_http.js"; enum STATUS_CODES { /** RFC 7231, 6.2.1 */ @@ -191,8 +188,11 @@ const METHODS = [ type Chunk = string | Buffer | Uint8Array; -const DenoServe = flash.createServe(ops.op_node_unstable_flash_serve); -const DenoUpgradeHttpRaw = flash.upgradeHttpRaw; +// @ts-ignore Deno[Deno.internal] is used on purpose here +const DenoServe = Deno[Deno.internal]?.nodeUnstable?.serve || Deno.serve; +// @ts-ignore Deno[Deno.internal] is used on purpose here +const DenoUpgradeHttpRaw = Deno[Deno.internal]?.nodeUnstable?.upgradeHttpRaw || + Deno.upgradeHttpRaw; const ENCODER = new TextEncoder(); |