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

added HttpRequest::encoding() method; fix urlencoded parsing with charset

This commit is contained in:
Nikolay Kim
2018-02-27 11:31:54 -08:00
parent 5dcb558f50
commit 6c480fae90
7 changed files with 127 additions and 28 deletions

View File

@ -36,8 +36,7 @@ impl Actor for MyWebSocket {
type Context = ws::WebsocketContext<Self, AppState>;
}
impl Handler<ws::Message> for MyWebSocket {
type Result = ();
impl StreamHandler<ws::Message, ws::WsError> for MyWebSocket {
fn handle(&mut self, msg: ws::Message, ctx: &mut Self::Context) {
self.counter += 1;
@ -46,7 +45,7 @@ impl Handler<ws::Message> for MyWebSocket {
ws::Message::Ping(msg) => ctx.pong(&msg),
ws::Message::Text(text) => ctx.text(text),
ws::Message::Binary(bin) => ctx.binary(bin),
ws::Message::Close(_) | ws::Message::Error => {
ws::Message::Close(_) => {
ctx.stop();
}
_ => (),