From b047413b39fa98daf6a94e999512d295200d80ef Mon Sep 17 00:00:00 2001 From: Huston Bokinsky Date: Tue, 28 Apr 2020 19:13:09 -0700 Subject: [PATCH] Small ws codec fix (#1465) * Small ws codec fix * Update actix-http/Changes.md Co-authored-by: Huston Bokinsky --- actix-http/CHANGES.md | 2 ++ actix-http/src/ws/codec.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 140d78e9..43f189af 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -7,6 +7,8 @@ * Implement `std::error::Error` for our custom errors [#1422] * Remove `failure` support for `ResponseError` since that crate will be deprecated in the near future. +* Fix a mistake in the encoding of websocket continuation messages wherein + Item::FirstText and Item::FirstBinary are each encoded as the other. [#1422]: https://github.com/actix/actix-web/pull/1422 diff --git a/actix-http/src/ws/codec.rs b/actix-http/src/ws/codec.rs index a37208a2..733976a7 100644 --- a/actix-http/src/ws/codec.rs +++ b/actix-http/src/ws/codec.rs @@ -137,7 +137,7 @@ impl Encoder for Codec { Parser::write_message( dst, &data[..], - OpCode::Binary, + OpCode::Text, false, !self.flags.contains(Flags::SERVER), ) @@ -151,7 +151,7 @@ impl Encoder for Codec { Parser::write_message( dst, &data[..], - OpCode::Text, + OpCode::Binary, false, !self.flags.contains(Flags::SERVER), )