summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-09-15 16:15:01 -0400
committerGitHub <noreply@github.com>2020-09-15 16:15:01 -0400
commit0715803b7fdf6399f447f9fd2fdd2aa8b41beac7 (patch)
tree657d020cfec478f25a3bba6debf3c8965abc27f7 /cli/worker.rs
parentb2fa903d64c74d64685397bbf4e98b031371d346 (diff)
Remove http_client from CliState, store in OpState directly (#7497)
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 4141d5008..b60b5a0c0 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -107,12 +107,13 @@ impl Worker {
state: &Rc<CliState>,
) -> Self {
let global_state = state.global_state.clone();
+ let global_state_ = global_state.clone();
let mut isolate = JsRuntime::new(RuntimeOptions {
module_loader: Some(state.clone()),
startup_snapshot,
js_error_create_fn: Some(Box::new(move |core_js_error| {
- JsError::create(core_js_error, &global_state.ts_compiler)
+ JsError::create(core_js_error, &global_state_.ts_compiler)
})),
..Default::default()
});
@@ -121,6 +122,10 @@ impl Worker {
let mut op_state = op_state.borrow_mut();
op_state.get_error_class_fn = &crate::errors::get_error_class_name;
op_state.put(state.clone());
+
+ let ca_file = global_state.flags.ca_file.as_deref();
+ let client = crate::http_util::create_http_client(ca_file).unwrap();
+ op_state.put(client);
}
let inspector = {
let global_state = &state.global_state;