This commit is contained in:
Koxiaet 2020-09-14 20:20:15 +01:00
parent 91f059f9ee
commit 84be87aab6

View File

@ -33,7 +33,9 @@ pub async fn receive_body(
} }
/// Receive a GraphQL request from a body as JSON. /// Receive a GraphQL request from a body as JSON.
pub async fn receive_json(body: impl AsyncRead + Send + 'static) -> Result<Request, ParseRequestError> { pub async fn receive_json(
body: impl AsyncRead + Send + 'static,
) -> Result<Request, ParseRequestError> {
let mut data = Vec::new(); let mut data = Vec::new();
futures::pin_mut!(body); futures::pin_mut!(body);
body.read_to_end(&mut data) body.read_to_end(&mut data)