#![cfg(feature = "http3")]
use hpx::Client;
use http::Version;
type TestResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync>>;
#[tokio::test]
#[ignore]
async fn http3_get_cloudflare_trace() -> TestResult<()> {
let client = Client::builder().http3_only().build()?;
let response = client
.get("https://cloudflare.com/cdn-cgi/trace")
.send()
.await?;
assert_eq!(
response.status(),
http::StatusCode::OK,
"expected 200 OK from Cloudflare trace endpoint"
);
assert_eq!(
response.version(),
Version::HTTP_3,
"expected HTTP/3 version from Cloudflare trace endpoint"
);
let body = response.text().await?;
assert!(
body.contains("h="),
"expected trace output to contain 'h=' (host header line), got: {body}"
);
Ok(())
}