fix(axum-core): skip non-data frames in BytesMut (#3811)

This commit is contained in:
Minh Vu
2026-07-23 23:08:47 +02:00
committed by GitHub
parent 0704574455
commit 502aa875b7
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -14,9 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **changed:** `impl IntoResponse for ()` (which gets called by
`impl IntoResponse for HeaderMap`, `impl IntoResponse for Extensions` and
others) now returns a body of unknown size.
- **fixed:** Make the `BytesMut` extractor ignore non-data frames from custom
request bodies, matching the `Bytes` extractor ([#3811])
[#3721]: https://github.com/tokio-rs/axum/pull/3721
[#3742]: https://github.com/tokio-rs/axum/pull/3742
[#3811]: https://github.com/tokio-rs/axum/pull/3811
# 0.5.6
+2 -1
View File
@@ -89,7 +89,8 @@ async fn body_to_bytes_mut(body: &mut Body, bytes: &mut BytesMut) -> Result<(),
.map_err(FailedToBufferBody::from_err)?
{
let Ok(data) = frame.into_data() else {
return Ok(());
// Match `Bytes` by ignoring non-data frames until the body ends.
continue;
};
bytes.put(data);
}