diff --git a/pingora-core/Cargo.toml b/pingora-core/Cargo.toml index e2854966..2939e613 100644 --- a/pingora-core/Cargo.toml +++ b/pingora-core/Cargo.toml @@ -86,7 +86,7 @@ windows-sys = { version = "0.59.0", features = ["Win32_Networking_WinSock"] } h2 = { workspace = true, features = ["unstable"] } tokio-stream = { version = "0.1", features = ["full"] } env_logger = "0.11" -reqwest = { version = "0.11", features = [ +reqwest = { version = "0.12", features = [ "rustls-tls", ], default-features = false } hyper = "0.14" diff --git a/pingora-proxy/Cargo.toml b/pingora-proxy/Cargo.toml index d4df1378..267d0b1a 100644 --- a/pingora-proxy/Cargo.toml +++ b/pingora-proxy/Cargo.toml @@ -36,14 +36,14 @@ regex = "1" rand = "0.8" [dev-dependencies] -reqwest = { version = "0.11", features = [ +reqwest = { version = "0.12", features = [ "gzip", "rustls-tls", ], default-features = false } httparse = { workspace = true } tokio-test = "0.4" env_logger = "0.11" -hyper = "0.14" +hyper = { version = "0.14", features = ["http2"] } tokio-tungstenite = "0.20.1" pingora-limits = { version = "0.8.0", path = "../pingora-limits" } pingora-load-balancing = { version = "0.8.0", path = "../pingora-load-balancing", default-features=false } diff --git a/pingora-proxy/tests/test_basic.rs b/pingora-proxy/tests/test_basic.rs index 77303fc3..2b935b6e 100644 --- a/pingora-proxy/tests/test_basic.rs +++ b/pingora-proxy/tests/test_basic.rs @@ -172,8 +172,8 @@ async fn test_h2c_to_h2c() { req.headers_mut() .insert("x-h2", HeaderValue::from_bytes(b"true").unwrap()); let res = client.request(req).await.unwrap(); - assert_eq!(res.status(), reqwest::StatusCode::OK); - assert_eq!(res.version(), reqwest::Version::HTTP_2); + assert_eq!(res.status(), hyper::StatusCode::OK); + assert_eq!(res.version(), hyper::Version::HTTP_2); let body = res.into_body().data().await.unwrap().unwrap(); assert_eq!(body.as_ref(), b"Hello World!\n"); @@ -194,8 +194,8 @@ async fn test_h1_on_h2c_port() { req.headers_mut() .insert("x-h2", HeaderValue::from_bytes(b"true").unwrap()); let res = client.request(req).await.unwrap(); - assert_eq!(res.status(), reqwest::StatusCode::OK); - assert_eq!(res.version(), reqwest::Version::HTTP_11); + assert_eq!(res.status(), hyper::StatusCode::OK); + assert_eq!(res.version(), hyper::Version::HTTP_11); let body = res.into_body().data().await.unwrap().unwrap(); assert_eq!(body.as_ref(), b"Hello World!\n"); @@ -307,11 +307,11 @@ async fn test_simple_proxy_uds() { let res = client.get(url).await.unwrap(); - assert_eq!(res.status(), reqwest::StatusCode::OK); + assert_eq!(res.status(), hyper::StatusCode::OK); let (resp, body) = res.into_parts(); let headers = &resp.headers; - assert_eq!(headers[header::CONTENT_LENGTH], "13"); + assert_eq!(headers[hyper::header::CONTENT_LENGTH], "13"); assert_eq!(headers["x-server-addr"], "/tmp/pingora_proxy.sock"); assert_eq!(headers["x-client-addr"], "unset"); // unnamed UDS diff --git a/pingora-proxy/tests/test_upstream.rs b/pingora-proxy/tests/test_upstream.rs index 9ae4511e..572f5c71 100644 --- a/pingora-proxy/tests/test_upstream.rs +++ b/pingora-proxy/tests/test_upstream.rs @@ -18,8 +18,9 @@ use utils::server_utils::init; use utils::websocket::{WS_ECHO, WS_ECHO_RAW}; use futures::{SinkExt, StreamExt}; +use hyper::header::HeaderValue; use pingora_http::ResponseHeader; -use reqwest::header::{HeaderName, HeaderValue}; +use reqwest::header::{HeaderName, HeaderValue as ReqwestHeaderValue}; use reqwest::{StatusCode, Version}; use std::time::{Duration, Instant}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; @@ -374,7 +375,7 @@ async fn test_download_timeout() { .body(hyper::Body::empty()) .unwrap(); let mut res = client.request(req).await.unwrap(); - assert_eq!(res.status(), StatusCode::OK); + assert_eq!(res.status(), hyper::StatusCode::OK); let mut err = false; sleep(Duration::from_secs(2)).await; @@ -401,7 +402,7 @@ async fn test_download_timeout_min_rate() { .body(hyper::Body::empty()) .unwrap(); let mut res = client.request(req).await.unwrap(); - assert_eq!(res.status(), StatusCode::OK); + assert_eq!(res.status(), hyper::StatusCode::OK); let mut err = false; sleep(Duration::from_secs(2)).await; @@ -2924,7 +2925,7 @@ mod test_cache { .map(|(name, value)| { ( HeaderName::from_str(name).unwrap(), - HeaderValue::from_str(value).unwrap(), + ReqwestHeaderValue::from_str(value).unwrap(), ) }) .collect(); diff --git a/pingora/Cargo.toml b/pingora/Cargo.toml index d9fb57c2..8c11fb18 100644 --- a/pingora/Cargo.toml +++ b/pingora/Cargo.toml @@ -37,7 +37,7 @@ document-features = { version = "0.2.10", optional = true } clap = { version = "4.5", features = ["derive"] } tokio = { workspace = true, features = ["rt-multi-thread", "signal"] } env_logger = "0.11" -reqwest = { version = "0.11", features = ["rustls"], default-features = false } +reqwest = { version = "0.12", features = ["rustls-tls"], default-features = false } hyper = "0.14" async-trait = { workspace = true } http = { workspace = true }