From 9f26ca450936da66e57dad2206d0d11363e7b35c Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Tue, 19 Nov 2024 10:46:24 +0900 Subject: feat(ext/http): Make http server parameters configurable (#26785) This commit makes http server parameters configurable on the extension initialization via two callbacks users can provide. The main motivation behind this change is to allow `deno_http` users to tune the HTTP/2 server to suit their needs, although Deno CLI users will not benefit from it as no JavaScript interface is exposed to set these parameters currently. It is up to users whether to provide hook functions. If not provided, the default configuration from hyper crate will be used. --- runtime/snapshot.rs | 4 +++- runtime/web_worker.rs | 4 +++- runtime/worker.rs | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs index 7f6e6b8ab..3bf515131 100644 --- a/runtime/snapshot.rs +++ b/runtime/snapshot.rs @@ -300,7 +300,9 @@ pub fn create_runtime_snapshot( deno_cron::local::LocalCronHandler::new(), ), deno_napi::deno_napi::init_ops_and_esm::(), - deno_http::deno_http::init_ops_and_esm::(), + deno_http::deno_http::init_ops_and_esm::( + deno_http::Options::default(), + ), deno_io::deno_io::init_ops_and_esm(Default::default()), deno_fs::deno_fs::init_ops_and_esm::(fs.clone()), deno_node::deno_node::init_ops_and_esm::(None, fs.clone()), diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index 8e0c870d1..a282d11b9 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -497,7 +497,9 @@ impl WebWorker { ), deno_cron::deno_cron::init_ops_and_esm(LocalCronHandler::new()), deno_napi::deno_napi::init_ops_and_esm::(), - deno_http::deno_http::init_ops_and_esm::(), + deno_http::deno_http::init_ops_and_esm::( + deno_http::Options::default(), + ), deno_io::deno_io::init_ops_and_esm(Some(options.stdio)), deno_fs::deno_fs::init_ops_and_esm::( services.fs.clone(), diff --git a/runtime/worker.rs b/runtime/worker.rs index 99123463c..909147df9 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -407,7 +407,9 @@ impl MainWorker { ), deno_cron::deno_cron::init_ops_and_esm(LocalCronHandler::new()), deno_napi::deno_napi::init_ops_and_esm::(), - deno_http::deno_http::init_ops_and_esm::(), + deno_http::deno_http::init_ops_and_esm::( + deno_http::Options::default(), + ), deno_io::deno_io::init_ops_and_esm(Some(options.stdio)), deno_fs::deno_fs::init_ops_and_esm::( services.fs.clone(), -- cgit v1.2.3