diff --git a/Cargo.toml b/Cargo.toml index df6c669..9c60471 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,8 @@ futures = { version = "0.3.8", optional = true } async-tls = { version = "0.10.0", optional = true } # hyper_client -hyper = { version = "0.13.6", features = ["tcp"], optional = true } -hyper-tls = { version = "0.4.3", optional = true } +hyper = { version = "0.14.4", features = ["tcp", "client", "stream", "http1", "http2"], optional = true } +hyper-tls = { version = "0.5.0", optional = true } futures-util = { version = "0.3.5", features = ["io"], optional = true } # curl_client @@ -84,12 +84,17 @@ features = [ "WorkerGlobalScope", ] +[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom] +version = "0.2.2" +features = ["js"] + [dev-dependencies] async-std = { version = "1.6.0", features = ["unstable", "attributes"] } portpicker = "0.1.0" tide = { version = "0.15.0", default-features = false, features = ["h1-server"] } tide-rustls = { version = "0.1.4" } -tokio = { version = "0.2.21", features = ["macros"] } +tokio = { version = "1", features = ["macros", "time"] } serde = "1.0" serde_json = "1.0" mockito = "0.23.3" +hyper = { version = "0.14.4", features = ["server"] } diff --git a/src/hyper.rs b/src/hyper.rs index f88ee8a..01c667a 100644 --- a/src/hyper.rs +++ b/src/hyper.rs @@ -177,7 +177,7 @@ mod tests { req.set_body("hello"); let client = async move { - tokio::time::delay_for(Duration::from_millis(100)).await; + tokio::time::sleep(Duration::from_millis(100)).await; let mut resp = client.send(req).await?; send.send(()).unwrap(); assert_eq!(resp.body_string().await?, "hello");