1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

fix awc tests

This commit is contained in:
Nikolay Kim
2019-12-20 17:27:32 +06:00
parent c877840c07
commit 74fa4060c2
3 changed files with 73 additions and 48 deletions

View File

@ -4,9 +4,9 @@ use std::sync::Arc;
use actix_http::HttpService;
use actix_http_test::test_server;
use actix_service::{pipeline_factory, ServiceFactory};
use actix_service::{map_config, pipeline_factory, IntoServiceFactory, ServiceFactory};
use actix_web::http::Version;
use actix_web::{web, App, HttpResponse};
use actix_web::{dev::AppConfig, web, App, HttpResponse};
use futures::future::ok;
use open_ssl::ssl::{SslAcceptor, SslConnector, SslFiletype, SslMethod, SslVerifyMode};
@ -44,8 +44,14 @@ async fn test_connection_reuse_h2() {
})
.and_then(
HttpService::build()
.h2(App::new()
.service(web::resource("/").route(web::to(|| HttpResponse::Ok()))))
.h2(map_config(
App::new()
.service(
web::resource("/").route(web::to(|| HttpResponse::Ok())),
)
.into_factory(),
|_| AppConfig::default(),
))
.openssl(ssl_acceptor())
.map_err(|_| ()),
)