Add Body::from_stream (#1848)

This commit is contained in:
David Pedersen
2023-04-21 17:45:31 +02:00
parent 4e4c29175f
commit 72c1b7a80c
7 changed files with 79 additions and 29 deletions
+2 -2
View File
@@ -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