summaryrefslogtreecommitdiff
path: root/ext/http/01_http.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r--ext/http/01_http.js72
1 files changed, 39 insertions, 33 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index 64951ee0f..92f1fd03e 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -1,7 +1,43 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { core, internals, primordials } from "ext:core/mod.js";
-const { BadResourcePrototype, InterruptedPrototype, ops } = core;
+const {
+ BadResourcePrototype,
+ InterruptedPrototype,
+} = core;
+const {
+ op_http_accept,
+ op_http_headers,
+ op_http_shutdown,
+ op_http_upgrade,
+ op_http_upgrade_websocket,
+ op_http_websocket_accept_header,
+ op_http_write,
+ op_http_write_headers,
+ op_http_write_resource,
+} = core.ensureFastOps();
+const {
+ ArrayPrototypeIncludes,
+ ArrayPrototypeMap,
+ ArrayPrototypePush,
+ Error,
+ ObjectPrototypeIsPrototypeOf,
+ SafeSet,
+ SafeSetIterator,
+ SetPrototypeAdd,
+ SetPrototypeDelete,
+ StringPrototypeCharCodeAt,
+ StringPrototypeIncludes,
+ StringPrototypeSplit,
+ StringPrototypeToLowerCase,
+ StringPrototypeToUpperCase,
+ Symbol,
+ SymbolAsyncIterator,
+ TypeError,
+ TypedArrayPrototypeGetSymbolToStringTag,
+ Uint8Array,
+} = primordials;
+
import { InnerBody } from "ext:deno_fetch/22_body.js";
import { Event, setEventTargetData } from "ext:deno_web/02_event.js";
import { BlobPrototype } from "ext:deno_web/09_file.js";
@@ -42,36 +78,6 @@ import {
} from "ext:deno_web/06_streams.js";
import { serve } from "ext:deno_http/00_serve.js";
import { SymbolDispose } from "ext:deno_web/00_infra.js";
-const {
- ArrayPrototypeIncludes,
- ArrayPrototypeMap,
- ArrayPrototypePush,
- Error,
- ObjectPrototypeIsPrototypeOf,
- SafeSet,
- SafeSetIterator,
- SetPrototypeAdd,
- SetPrototypeDelete,
- StringPrototypeCharCodeAt,
- StringPrototypeIncludes,
- StringPrototypeSplit,
- StringPrototypeToLowerCase,
- StringPrototypeToUpperCase,
- Symbol,
- SymbolAsyncIterator,
- TypeError,
- TypedArrayPrototypeGetSymbolToStringTag,
- Uint8Array,
-} = primordials;
-const {
- op_http_accept,
- op_http_shutdown,
- op_http_upgrade,
- op_http_write,
- op_http_upgrade_websocket,
- op_http_write_headers,
- op_http_write_resource,
-} = core.ensureFastOps();
const connErrorSymbol = Symbol("connError");
const _deferred = Symbol("upgradeHttpDeferred");
@@ -152,7 +158,7 @@ class HttpConn {
const innerRequest = newInnerRequest(
method,
url,
- () => ops.op_http_headers(streamRid),
+ () => op_http_headers(streamRid),
body !== null ? new InnerBody(body) : null,
false,
);
@@ -455,7 +461,7 @@ function upgradeWebSocket(request, options = {}) {
);
}
- const accept = ops.op_http_websocket_accept_header(websocketKey);
+ const accept = op_http_websocket_accept_header(websocketKey);
const r = newInnerResponse(101);
r.headerList = [