Skip to content

Commit

Permalink
Fix Json extractor to be 32kB by default (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy authored Feb 18, 2021
1 parent 946ccca commit 3b93c62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
## Unreleased - 2021-xx-xx
### Changed
* Feature `cookies` is now optional and enabled by default. [#1981]
* `JsonBody::new` returns a default limit of 32kB to be consistent with `JsonConfig` and the
default behaviour of the `web::Json<T>` extractor. [#2010]

[#1981]: https://github.com/actix/actix-web/pull/1981
[#2010]: https://github.com/actix/actix-web/pull/2010


## 4.0.0-beta.3 - 2021-02-10
Expand Down
4 changes: 2 additions & 2 deletions src/types/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,15 @@ where
let payload = payload.take();

JsonBody::Body {
limit: 262_144,
limit: 32_768,
length,
payload,
buf: BytesMut::with_capacity(8192),
_res: PhantomData,
}
}

/// Set maximum accepted payload size. The default limit is 256kB.
/// Set maximum accepted payload size. The default limit is 32kB.
pub fn limit(self, limit: usize) -> Self {
match self {
JsonBody::Body {
Expand Down

0 comments on commit 3b93c62

Please sign in to comment.