mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
fix(axum-core): skip non-data frames in BytesMut (#3811)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user