diff options
Diffstat (limited to 'runtime/ops/fetch.rs')
-rw-r--r-- | runtime/ops/fetch.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/ops/fetch.rs b/runtime/ops/fetch.rs index e1b43c910..9ab86858d 100644 --- a/runtime/ops/fetch.rs +++ b/runtime/ops/fetch.rs @@ -1,7 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use crate::http_util; use crate::permissions::Permissions; use deno_fetch::reqwest; +use deno_fetch::HttpClientDefaults; pub fn init( rt: &mut deno_core::JsRuntime, @@ -12,7 +12,12 @@ pub fn init( let op_state = rt.op_state(); let mut state = op_state.borrow_mut(); state.put::<reqwest::Client>({ - http_util::create_http_client(user_agent, ca_data).unwrap() + deno_fetch::create_http_client(user_agent.clone(), ca_data.clone()) + .unwrap() + }); + state.put::<HttpClientDefaults>(HttpClientDefaults { + ca_data, + user_agent, }); } super::reg_json_sync(rt, "op_fetch", deno_fetch::op_fetch::<Permissions>); |