mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Add Body::from_stream (#1848)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use axum::{
|
||||
async_trait,
|
||||
body::{Body, StreamBody},
|
||||
body::Body,
|
||||
extract::FromRequest,
|
||||
response::{IntoResponse, Response},
|
||||
BoxError,
|
||||
@@ -166,7 +166,7 @@ where
|
||||
buf.write_all(b"\n")?;
|
||||
Ok::<_, BoxError>(buf.into_inner().freeze())
|
||||
});
|
||||
let stream = StreamBody::new(stream);
|
||||
let stream = Body::from_stream(stream);
|
||||
|
||||
// there is no consensus around mime type yet
|
||||
// https://github.com/wardi/jsonlines/issues/36
|
||||
|
||||
Reference in New Issue
Block a user