Fix compilation of juniper_rocket_async: add limit to Data::open() call (#733)
This commit is contained in:
parent
54e0e208fc
commit
bdc8745a56
2 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ use juniper::{Context, EmptyMutation, EmptySubscription};
|
|||
# Ok(&self.name)
|
||||
# }
|
||||
#
|
||||
# fn friends(context: &Database) -> FieldResult<Vec<&User>> {
|
||||
# fn friends(&self, context: &Database) -> FieldResult<Vec<&User>> {
|
||||
# Ok(self.friend_ids.iter()
|
||||
# .filter_map(|id| executor.context().users.get(id))
|
||||
# .collect())
|
||||
|
|
|
@ -41,7 +41,7 @@ Check the LICENSE file for details.
|
|||
use std::io::Cursor;
|
||||
|
||||
use rocket::{
|
||||
data::{self, FromData},
|
||||
data::{self, FromData, ToByteUnit},
|
||||
http::{ContentType, RawStr, Status},
|
||||
outcome::Outcome::{Failure, Forward, Success},
|
||||
request::{FormItems, FromForm, FromFormValue},
|
||||
|
@ -305,7 +305,7 @@ where
|
|||
|
||||
Box::pin(async move {
|
||||
let mut body = String::new();
|
||||
let mut reader = data.open().take(BODY_LIMIT);
|
||||
let mut reader = data.open(BODY_LIMIT.bytes());
|
||||
if let Err(e) = reader.read_to_string(&mut body).await {
|
||||
return Failure((Status::InternalServerError, format!("{:?}", e)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue