From be59e93220e24a2e66ae2843a136e61eab9d8ac3 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Sat, 27 May 2023 15:42:20 +0200 Subject: refactor(node/http): don't use readablestream for writing to request (#19282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactors the internal usage of a readablestream to write to the resource directly --------- Co-authored-by: Bartek IwaƄczuk --- runtime/build.rs | 7 +++++++ runtime/permissions/mod.rs | 10 ++++++++++ 2 files changed, 17 insertions(+) (limited to 'runtime') diff --git a/runtime/build.rs b/runtime/build.rs index bd141d297..334c3b11a 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -122,6 +122,13 @@ mod startup_snapshot { } impl deno_node::NodePermissions for Permissions { + fn check_net_url( + &mut self, + _url: &deno_core::url::Url, + _api_name: &str, + ) -> Result<(), deno_core::error::AnyError> { + unreachable!("snapshotting!") + } fn check_read(&self, _p: &Path) -> Result<(), deno_core::error::AnyError> { unreachable!("snapshotting!") } diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 6cce7d1e9..f1d0362ca 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -13,6 +13,7 @@ use deno_core::serde::Deserializer; use deno_core::serde::Serialize; use deno_core::serde_json; use deno_core::url; +use deno_core::url::Url; use deno_core::ModuleSpecifier; use deno_core::OpState; use log; @@ -1871,6 +1872,15 @@ impl PermissionsContainer { } impl deno_node::NodePermissions for PermissionsContainer { + #[inline(always)] + fn check_net_url( + &mut self, + url: &Url, + api_name: &str, + ) -> Result<(), AnyError> { + self.0.lock().net.check_url(url, Some(api_name)) + } + #[inline(always)] fn check_read(&self, path: &Path) -> Result<(), AnyError> { self.0.lock().read.check(path, None) -- cgit v1.2.3