mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
remove http-codes builders from actix-http (#2159)
This commit is contained in:
@ -33,7 +33,7 @@ const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
||||
async fn test_h1_v2() {
|
||||
let srv = test_server(move || {
|
||||
HttpService::build()
|
||||
.finish(|_| future::ok::<_, ()>(Response::Ok().body(STR)))
|
||||
.finish(|_| future::ok::<_, ()>(Response::ok().set_body(STR)))
|
||||
.tcp()
|
||||
})
|
||||
.await;
|
||||
@ -61,7 +61,7 @@ async fn test_h1_v2() {
|
||||
async fn test_connection_close() {
|
||||
let srv = test_server(move || {
|
||||
HttpService::build()
|
||||
.finish(|_| future::ok::<_, ()>(Response::Ok().body(STR)))
|
||||
.finish(|_| future::ok::<_, ()>(Response::ok().set_body(STR)))
|
||||
.tcp()
|
||||
.map(|_| ())
|
||||
})
|
||||
@ -77,9 +77,9 @@ async fn test_with_query_parameter() {
|
||||
HttpService::build()
|
||||
.finish(|req: Request| {
|
||||
if req.uri().query().unwrap().contains("qp=") {
|
||||
future::ok::<_, ()>(Response::Ok().finish())
|
||||
future::ok::<_, ()>(Response::ok())
|
||||
} else {
|
||||
future::ok::<_, ()>(Response::BadRequest().finish())
|
||||
future::ok::<_, ()>(Response::bad_request())
|
||||
}
|
||||
})
|
||||
.tcp()
|
||||
@ -112,7 +112,7 @@ async fn test_h1_expect() {
|
||||
let str = std::str::from_utf8(&buf).unwrap();
|
||||
assert_eq!(str, "expect body");
|
||||
|
||||
Ok::<_, ()>(Response::Ok().finish())
|
||||
Ok::<_, ()>(Response::ok())
|
||||
})
|
||||
.tcp()
|
||||
})
|
||||
|
Reference in New Issue
Block a user