mirror of https://github.com/fafhrd91/actix-web
fix changelog
This commit is contained in:
parent
7b39da96e4
commit
dd985490c8
|
@ -10,6 +10,7 @@
|
||||||
* Impl `MessageBody` for `bytestring::ByteString`. [#2468]
|
* Impl `MessageBody` for `bytestring::ByteString`. [#2468]
|
||||||
* `impl Clone for ws::HandshakeError`. [#2468]
|
* `impl Clone for ws::HandshakeError`. [#2468]
|
||||||
* `#[must_use]` for `ws::Codec` to prevent subtle bugs. [#1920]
|
* `#[must_use]` for `ws::Codec` to prevent subtle bugs. [#1920]
|
||||||
|
* `impl Default ` for `ws::Codec`. [#1920]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* Rename `body::BoxBody::{from_body => new}`. [#2468]
|
* Rename `body::BoxBody::{from_body => new}`. [#2468]
|
||||||
|
@ -19,7 +20,6 @@
|
||||||
* `From` implementations on error types now return a `Response<BoxBody>`. [#2468]
|
* `From` implementations on error types now return a `Response<BoxBody>`. [#2468]
|
||||||
* `ResponseBuilder::body(B)` now returns `Response<EitherBody<B>>`. [#2468]
|
* `ResponseBuilder::body(B)` now returns `Response<EitherBody<B>>`. [#2468]
|
||||||
* `ResponseBuilder::finish()` now returns `Response<EitherBody<()>>`. [#2468]
|
* `ResponseBuilder::finish()` now returns `Response<EitherBody<()>>`. [#2468]
|
||||||
* `impl Copy` for `ws::Codec`. [#1920]
|
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
* `ResponseBuilder::streaming`. [#2468]
|
* `ResponseBuilder::streaming`. [#2468]
|
||||||
|
|
|
@ -90,7 +90,7 @@ impl Codec {
|
||||||
/// Set max frame size.
|
/// Set max frame size.
|
||||||
///
|
///
|
||||||
/// By default max size is set to 64KiB.
|
/// By default max size is set to 64KiB.
|
||||||
#[must_use = "this returns the a new Codec, without modifying the original"]
|
#[must_use = "This returns the a new Codec, without modifying the original."]
|
||||||
pub fn max_size(mut self, size: usize) -> Self {
|
pub fn max_size(mut self, size: usize) -> Self {
|
||||||
self.max_size = size;
|
self.max_size = size;
|
||||||
self
|
self
|
||||||
|
@ -99,7 +99,7 @@ impl Codec {
|
||||||
/// Set decoder to client mode.
|
/// Set decoder to client mode.
|
||||||
///
|
///
|
||||||
/// By default decoder works in server mode.
|
/// By default decoder works in server mode.
|
||||||
#[must_use = "this returns the a new Codec, without modifying the original"]
|
#[must_use = "This returns the a new Codec, without modifying the original."]
|
||||||
pub fn client_mode(mut self) -> Self {
|
pub fn client_mode(mut self) -> Self {
|
||||||
self.flags.remove(Flags::SERVER);
|
self.flags.remove(Flags::SERVER);
|
||||||
self
|
self
|
||||||
|
|
|
@ -55,7 +55,7 @@ async fn common_test_code(mut srv: actix_test::TestServer, frame_size: usize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder() {
|
async fn simple_builder() {
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
@ -68,7 +68,7 @@ async fn test_builder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_with_frame_size() {
|
async fn builder_with_frame_size() {
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
@ -83,7 +83,7 @@ async fn test_builder_with_frame_size() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_with_frame_size_exceeded() {
|
async fn builder_with_frame_size_exceeded() {
|
||||||
const MAX_FRAME_SIZE: usize = 64;
|
const MAX_FRAME_SIZE: usize = 64;
|
||||||
|
|
||||||
let mut srv = actix_test::start(|| {
|
let mut srv = actix_test::start(|| {
|
||||||
|
@ -112,7 +112,7 @@ async fn test_builder_with_frame_size_exceeded() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_with_codec() {
|
async fn builder_with_codec() {
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
@ -127,7 +127,7 @@ async fn test_builder_with_codec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_with_protocols() {
|
async fn builder_with_protocols() {
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
@ -142,7 +142,23 @@ async fn test_builder_with_protocols() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_full() {
|
async fn builder_with_codec_and_frame_size() {
|
||||||
|
let srv = actix_test::start(|| {
|
||||||
|
App::new().service(web::resource("/").to(
|
||||||
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
ws::WsResponseBuilder::new(Ws, &req, stream)
|
||||||
|
.codec(Codec::new())
|
||||||
|
.frame_size(MAX_FRAME_SIZE)
|
||||||
|
.start()
|
||||||
|
},
|
||||||
|
))
|
||||||
|
});
|
||||||
|
|
||||||
|
common_test_code(srv, DEFAULT_FRAME_SIZE).await;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[actix_rt::test]
|
||||||
|
async fn builder_full() {
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|req: HttpRequest, stream: web::Payload| async move {
|
||||||
|
@ -159,23 +175,7 @@ async fn test_builder_full() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_builder_with_codec_and_frame_size() {
|
async fn simple_start() {
|
||||||
let srv = actix_test::start(|| {
|
|
||||||
App::new().service(web::resource("/").to(
|
|
||||||
|req: HttpRequest, stream: web::Payload| async move {
|
|
||||||
ws::WsResponseBuilder::new(Ws, &req, stream)
|
|
||||||
.codec(Codec::new())
|
|
||||||
.frame_size(MAX_FRAME_SIZE)
|
|
||||||
.start()
|
|
||||||
},
|
|
||||||
))
|
|
||||||
});
|
|
||||||
|
|
||||||
common_test_code(srv, DEFAULT_FRAME_SIZE).await;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[actix_rt::test]
|
|
||||||
async fn test_simple() {
|
|
||||||
let srv = actix_test::start(|| {
|
let srv = actix_test::start(|| {
|
||||||
App::new().service(web::resource("/").to(
|
App::new().service(web::resource("/").to(
|
||||||
|req: HttpRequest, stream: web::Payload| async move { ws::start(Ws, &req, stream) },
|
|req: HttpRequest, stream: web::Payload| async move { ws::start(Ws, &req, stream) },
|
||||||
|
|
Loading…
Reference in New Issue