Make request body size Limit
configurable in juniper_rocket
(#1044)
This commit is contained in:
parent
4182a8cf2b
commit
1fa69ebcfa
2 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
- Compatibility with the latest `juniper`.
|
- Compatibility with the latest `juniper`.
|
||||||
- Provide `AsRef` and `AsMut` implementation for `GraphQLRequest` to its inner type ([#968](https://github.com/graphql-rust/juniper/pull/968), [#930](https://github.com/graphql-rust/juniper/issues/930)).
|
- Provide `AsRef` and `AsMut` implementation for `GraphQLRequest` to its inner type ([#968](https://github.com/graphql-rust/juniper/pull/968), [#930](https://github.com/graphql-rust/juniper/issues/930)).
|
||||||
|
- Ability to set custom request body size limit ([#1044](https://github.com/graphql-rust/juniper/pull/1044)).
|
||||||
|
|
||||||
# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.8.0)
|
# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.8.0)
|
||||||
|
|
||||||
|
|
|
@ -349,8 +349,9 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
|
let limit = req.limits().get("graphql").unwrap_or(BODY_LIMIT.bytes());
|
||||||
|
let mut reader = data.open(limit);
|
||||||
let mut body = String::new();
|
let mut body = String::new();
|
||||||
let mut reader = data.open(BODY_LIMIT.bytes());
|
|
||||||
if let Err(e) = reader.read_to_string(&mut body).await {
|
if let Err(e) = reader.read_to_string(&mut body).await {
|
||||||
return Failure((Status::InternalServerError, format!("{:?}", e)));
|
return Failure((Status::InternalServerError, format!("{:?}", e)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue