From 06f98e64aa48881a52027964049c2f3e60955931 Mon Sep 17 00:00:00 2001 From: Heinz Gies Date: Wed, 11 Sep 2019 15:04:44 +0200 Subject: [PATCH] Fix test for websocket ping --- actix-web-actors/Cargo.toml | 2 +- actix-web-actors/tests/test_ws.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/actix-web-actors/Cargo.toml b/actix-web-actors/Cargo.toml index 72063193c..6b1d23791 100644 --- a/actix-web-actors/Cargo.toml +++ b/actix-web-actors/Cargo.toml @@ -24,7 +24,7 @@ invalid-ping-payload = ["actix-http/invalid-ping-payload"] [dependencies] actix = "0.8.3" actix-web = "1.0.3" -actix-http = "0.2.5" +actix-http = { path = "../actix-http" } # "0.2.5" actix-codec = "0.1.2" bytes = "0.4" futures = "0.1.25" diff --git a/actix-web-actors/tests/test_ws.rs b/actix-web-actors/tests/test_ws.rs index 49b69a1e9..c804bb177 100644 --- a/actix-web-actors/tests/test_ws.rs +++ b/actix-web-actors/tests/test_ws.rs @@ -15,6 +15,9 @@ impl Actor for Ws { impl StreamHandler for Ws { fn handle(&mut self, msg: ws::Message, ctx: &mut Self::Context) { match msg { + #[cfg(feature = "invalid-ping-payload")] + ws::Message::Ping(msg) => ctx.pong(&msg), + #[cfg(not(feature = "invalid-ping-payload"))] ws::Message::Ping(msg) => ctx.pong(msg), ws::Message::Text(text) => ctx.text(text), ws::Message::Binary(bin) => ctx.binary(bin),