mirror of https://github.com/fafhrd91/actix-net
test: add test for new http version added
This commit is contained in:
parent
d491881d3d
commit
b8574770ce
|
@ -114,6 +114,25 @@ async fn test_openssl_uri() {
|
||||||
assert_eq!(con.peer_addr().unwrap(), srv.addr());
|
assert_eq!(con.peer_addr().unwrap(), srv.addr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "rustls-0_21", feature = "uri"))]
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn test_rustls_uri_http1() {
|
||||||
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
|
let srv = TestServer::start(|| {
|
||||||
|
fn_service(|io: TcpStream| async {
|
||||||
|
let mut framed = Framed::new(io, BytesCodec);
|
||||||
|
framed.send(Bytes::from_static(b"test")).await?;
|
||||||
|
Ok::<_, io::Error>(())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
let conn = Connector::default().service();
|
||||||
|
let addr = http_1::Uri::try_from(format!("https://localhost:{}", srv.port())).unwrap();
|
||||||
|
let con = conn.call(addr.into()).await.unwrap();
|
||||||
|
assert_eq!(con.peer_addr().unwrap(), srv.addr());
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "rustls-0_21", feature = "uri"))]
|
#[cfg(all(feature = "rustls-0_21", feature = "uri"))]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_rustls_uri() {
|
async fn test_rustls_uri() {
|
||||||
|
|
Loading…
Reference in New Issue