diff --git a/Cargo.lock b/Cargo.lock
index 71979d448a..3b53fb8d1e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -858,7 +858,7 @@ dependencies = [
"hickory-server",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"nix",
"once_cell",
@@ -1698,7 +1698,7 @@ dependencies = [
"hickory-resolver",
"http 1.1.0",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-rustls",
"hyper-util",
"ipnet",
@@ -1816,7 +1816,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",
@@ -2018,7 +2018,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",
@@ -2256,7 +2256,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",
@@ -2329,7 +2329,7 @@ dependencies = [
"deno_core",
"deno_error",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"log",
"once_cell",
@@ -2487,7 +2487,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",
@@ -3216,7 +3216,7 @@ dependencies = [
"base64 0.21.7",
"bytes",
"http-body-util",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"pin-project",
"rand",
@@ -4101,9 +4101,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",
@@ -4128,7 +4127,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
dependencies = [
"futures-util",
"http 1.1.0",
- "hyper 1.4.1",
+ "hyper 1.5.2",
"hyper-util",
"rustls",
"rustls-pki-types",
@@ -4144,7 +4143,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",
@@ -4162,7 +4161,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",
@@ -6324,7 +6323,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",
@@ -7864,7 +7863,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",
@@ -8159,7 +8158,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 48abe48305..ffd68b858e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -342,3 +342,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 64b6c006a1..da6801cdc8 100644
--- a/ext/node/lib.rs
+++ b/ext/node/lib.rs
@@ -370,6 +370,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