diff --git a/src/ext/web/mod.rs b/src/ext/web/mod.rs index 6c99020..77cd15b 100644 --- a/src/ext/web/mod.rs +++ b/src/ext/web/mod.rs @@ -29,7 +29,7 @@ impl ExtensionTrait for deno_fetch::deno_fetch { user_agent: options.user_agent.clone(), root_cert_store_provider: options.root_cert_store_provider.clone(), proxy: options.proxy.clone(), - request_builder_hook: None, // TODO(ysh) as it's not used + request_builder_hook: options.request_builder_hook, unsafely_ignore_certificate_errors: options.unsafely_ignore_certificate_errors.clone(), client_cert_chain_and_key: options.client_cert_chain_and_key.clone(), file_fetch_handler: options.file_fetch_handler.clone(), diff --git a/src/ext/web/options.rs b/src/ext/web/options.rs index fc00c0f..b8c3a23 100644 --- a/src/ext/web/options.rs +++ b/src/ext/web/options.rs @@ -1,5 +1,5 @@ use super::{DefaultWebPermissions, WebPermissions}; -use deno_core::error::AnyError; +use deno_error::JsErrorBox; use deno_fetch::dns::Resolver; use hyper_util::client::legacy::Builder; use std::sync::Arc; @@ -22,7 +22,7 @@ pub struct WebOptions { /// Request builder hook for fetch #[allow(clippy::type_complexity)] pub request_builder_hook: - Option) -> Result<(), AnyError>>, + Option) -> Result<(), JsErrorBox>>, /// List of domain names or IP addresses for which fetches and network OPs will ignore SSL errors /// diff --git a/src/runtime_builder.rs b/src/runtime_builder.rs index c4bdf2f..ee3d432 100644 --- a/src/runtime_builder.rs +++ b/src/runtime_builder.rs @@ -242,7 +242,7 @@ impl RuntimeBuilder { #[must_use] pub fn with_web_request_builder_hook( mut self, - hook: fn(&mut http::Request) -> Result<(), deno_core::error::AnyError>, + hook: fn(&mut http::Request) -> Result<(), deno_error::JsErrorBox>, ) -> Self { self.0.extension_options.web.request_builder_hook = Some(hook); self