summaryrefslogtreecommitdiff
path: root/cli/ops/fetch.rs
diff options
context:
space:
mode:
authorLuca Casonato <luca.casonato@antipy.com>2020-07-18 21:05:08 +0200
committerGitHub <noreply@github.com>2020-07-18 15:05:08 -0400
commit071a6e284aaaa26d40300b82d9f4cbb15a4dd6f5 (patch)
treeec66978303cb4b755366bbaab7028f9a3f455956 /cli/ops/fetch.rs
parentda48fa42d309e32684210a8d30ec3fc7ef7079df (diff)
Share reqwest client between fetch calls (#6792)
Diffstat (limited to 'cli/ops/fetch.rs')
-rw-r--r--cli/ops/fetch.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs
index 5a646325e..869c7c5b8 100644
--- a/cli/ops/fetch.rs
+++ b/cli/ops/fetch.rs
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use super::dispatch_json::{Deserialize, JsonOp, Value};
use super::io::{StreamResource, StreamResourceHolder};
-use crate::http_util::{create_http_client, HttpBody};
+use crate::http_util::HttpBody;
use crate::op_error::OpError;
use crate::state::State;
use deno_core::CoreIsolate;
@@ -33,8 +33,7 @@ pub fn op_fetch(
let args: FetchArgs = serde_json::from_value(args)?;
let url = args.url;
- let client =
- create_http_client(state.borrow().global_state.flags.ca_file.clone())?;
+ let client = &state.borrow().http_client;
let method = match args.method {
Some(method_str) => Method::from_bytes(method_str.as_bytes())