1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 14:49:20 +02:00

use TakeItem instead of TakeRequest

This commit is contained in:
Nikolay Kim
2018-10-08 07:55:01 -07:00
parent 8acf9eb98a
commit 30db78c19c
3 changed files with 6 additions and 81 deletions

View File

@ -12,6 +12,7 @@ use actix_net::codec::Framed;
use actix_net::framed::IntoFramed;
use actix_net::server::Server;
use actix_net::service::NewServiceExt;
use actix_net::stream::TakeItem;
use actix_web::{test, ws as web_ws};
use bytes::Bytes;
use futures::future::{ok, Either};
@ -36,7 +37,7 @@ fn test_simple() {
Server::new()
.bind("test", addr, move || {
IntoFramed::new(|| h1::Codec::new(false))
.and_then(h1::TakeRequest::new().map_err(|_| ()))
.and_then(TakeItem::new().map_err(|_| ()))
.and_then(|(req, framed): (_, Framed<_, _>)| {
// validate request
if let Some(h1::InMessage::MessageWithPayload(req)) = req {