diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index c057fef82..f052c6d22 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -3,6 +3,9 @@ ## Unreleased - Minimum supported Rust version (MSRV) is now 1.88. +- Fix truncated body ending without error when connection closed abnormally. [#3067] + +[#3067]: https://github.com/actix/actix-web/pull/3067 ## 3.11.2 @@ -96,9 +99,6 @@ - Add `body::to_bytes_limited()` function. - Add `body::BodyLimitExceeded` error type. -### Fixed -- Fix truncated body ending without error when connection closed abnormally. [#3067] - ### Changed - Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency. diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index ac19ef935..c59be2d50 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -1156,7 +1156,7 @@ where let inner = inner.as_mut().project(); inner.flags.insert(Flags::READ_DISCONNECT); if let Some(mut payload) = inner.payload.take() { - payload.set_error(io::Error::from(io::ErrorKind::UnexpectedEof).into()); + payload.set_error(PayloadError::Incomplete(None)); payload.feed_eof(); } };