diff --git a/CHANGES.md b/CHANGES.md index 8e030819f..f6eacf507 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ # Changes ## Unreleased - 2021-xx-xx +### Changed +- no longer requires `Scope` service body type to be boxed. [#2523] + +[#2523]: https://github.com/actix/actix-web/pull/2523 ## 4.0.0-beta.15 - 2021-12-17 diff --git a/src/scope.rs b/src/scope.rs index 172fdc270..b27a5cb08 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -986,9 +986,9 @@ mod tests { ); } - /// Any output body type should be accepted; test for `EitherBody` #[actix_rt::test] async fn test_middleware_body_type() { + // Compile test that Scope accepts any body type; test for `EitherBody` let srv = init_service( App::new().service( web::scope("app") @@ -1001,13 +1001,12 @@ mod tests { ) .await; - // test if `is_complete_body()` is preserved across scope layer + // test if `MessageBody::try_into_bytes()` is preserved across scope layer use actix_http::body::MessageBody as _; let req = TestRequest::with_uri("/app/test").to_request(); let resp = call_service(&srv, req).await; - let mut body = resp.into_body(); - assert!(body.is_complete_body()); - assert_eq!(body.take_complete_body(), b"hello".as_ref()); + let body = resp.into_body(); + assert_eq!(body.try_into_bytes().unwrap(), b"hello".as_ref()); } #[actix_rt::test]