From 7138bb2f293a0005e6ef3e77f0512a2891860a08 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 21 Jul 2018 01:00:50 -0700 Subject: [PATCH] update migration --- MIGRATION.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index f04aa2d2..29bf0c34 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,5 +1,31 @@ ## 0.7 +* `HttpRequest` does not implement `Stream` anymore. If you need to read request payload + use `HttpMessage::payload()` method. + + instead of + + ```rust + fn index(req: HttpRequest) -> impl Responder { + req + .from_err() + .fold(...) + .... + } + ``` + + use `.payload()` + + ```rust + fn index(req: HttpRequest) -> impl Responder { + req + .payload() // <- get request payload stream + .from_err() + .fold(...) + .... + } + ``` + * [Middleware](https://actix.rs/actix-web/actix_web/middleware/trait.Middleware.html) trait uses `&HttpRequest` instead of `&mut HttpRequest`.