diff --git a/Cargo.lock b/Cargo.lock
index 7a6108b2e7..b6807e627c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -856,7 +856,7 @@ dependencies = [
"hickory-server",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"nix",
"once_cell",
@@ -1702,7 +1702,7 @@ dependencies = [
"hickory-resolver",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-rustls",
"hyper-util",
"ipnet",
@@ -1820,7 +1820,7 @@ dependencies = [
"http-body-util",
"httparse",
"hyper 0.14.28",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"itertools 0.10.5",
"memmem",
@@ -2057,7 +2057,7 @@ dependencies = [
"hkdf",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"idna",
"indexmap 2.3.0",
@@ -2345,7 +2345,7 @@ dependencies = [
"http 1.1.0",
"http-body-util",
"hyper 0.14.28",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"libc",
"log",
@@ -2422,7 +2422,7 @@ dependencies = [
"deno_core",
"deno_error",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"log",
"once_cell",
@@ -2580,7 +2580,7 @@ dependencies = [
"h2 0.4.4",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"once_cell",
"rustls-tokio-stream",
@@ -3325,7 +3325,7 @@ dependencies = [
"base64 0.21.7",
"bytes",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"pin-project",
"rand",
@@ -4210,9 +4210,8 @@ dependencies = [
[[package]]
name = "hyper"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
+version = "1.5.2"
+source = "git+https://github.com/hyperium/hyper.git?rev=15227a3#15227a3006ae8b402394904ed4e1b86233f1bd65"
dependencies = [
"bytes",
"futures-channel",
@@ -4237,7 +4236,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
dependencies = [
"futures-util",
"http 1.1.0",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"rustls",
"rustls-pki-types",
@@ -4253,7 +4252,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
dependencies = [
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"pin-project-lite",
"tokio",
@@ -4271,7 +4270,7 @@ dependencies = [
"futures-util",
"http 1.1.0",
"http-body 1.0.0",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"pin-project-lite",
"socket2",
"tokio",
@@ -6433,7 +6432,7 @@ dependencies = [
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-rustls",
"hyper-util",
"ipnet",
@@ -7973,7 +7972,7 @@ dependencies = [
"h2 0.4.4",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"jsonc-parser",
"lazy-regex",
@@ -8268,7 +8267,7 @@ dependencies = [
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-timeout",
"hyper-util",
"percent-encoding",
diff --git a/Cargo.toml b/Cargo.toml
index 4ee2abe993..ebc85ca059 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -350,3 +350,6 @@ opt-level = 3
opt-level = 3
[profile.release.package.zstd-sys]
opt-level = 3
+
+[patch.crates-io]
+hyper = { git = "https://github.com/hyperium/hyper.git", rev = "15227a3" }
diff --git a/ext/node/lib.rs b/ext/node/lib.rs
index a0efc12657..49628c3db0 100644
--- a/ext/node/lib.rs
+++ b/ext/node/lib.rs
@@ -372,6 +372,7 @@ deno_core::extension!(deno_node,
ops::zlib::brotli::op_brotli_decompress_stream_end,
ops::http::op_node_http_fetch_response_upgrade,
ops::http::op_node_http_request_with_conn
,
+ ops::http::op_node_http_await_information,
ops::http::op_node_http_await_response,
ops::http2::op_http2_connect,
ops::http2::op_http2_poll_client_connection,
diff --git a/ext/node/ops/http.rs b/ext/node/ops/http.rs
index 9723b0d3be..57bcf69a47 100644
--- a/ext/node/ops/http.rs
+++ b/ext/node/ops/http.rs
@@ -11,6 +11,7 @@ use std::task::Poll;
use bytes::Bytes;
use deno_core::error::ResourceError;
+use deno_core::futures::channel::mpsc;
use deno_core::futures::stream::Peekable;
use deno_core::futures::Future;
use deno_core::futures::FutureExt;
@@ -70,9 +71,20 @@ pub struct NodeHttpResponse {
type CancelableResponseResult =
Result, hyper::Error>, Canceled>;
+#[derive(Serialize, Debug)]
+#[serde(rename_all = "camelCase")]
+struct InformationalResponse {
+ status: u16,
+ status_text: String,
+ headers: Vec<(ByteString, ByteString)>,
+ version_major: u16,
+ version_minor: u16,
+}
+
pub struct NodeHttpClientResponse {
response: Pin>>,
url: String,
+ informational_rx: RefCell