Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Json extractor to be 32kB by default #2010

Merged
merged 2 commits into from
Feb 18, 2021

Conversation

SuperFluffy
Copy link
Contributor

@SuperFluffy SuperFluffy commented Feb 18, 2021

PR Type

Other

PR Checklist

  • Tests for the changes have been added / updated. (not applicable)
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

While technically the default limit for JsonBody is indeed 256kB when called through JsonBody::new, in practice the limit is always set to 32kB for every context where JsonBody is used (via JsonConfig). This is also consistent with the documentation of the JsonError::Overflow, which mentions a default maximum of 32kB.

This commit changes the default to also be 32kB instead of 256kB.

Alternatives

The alternative to this commit is to instead change the default of JsonConfig to have a limit of 256kB instead of currently 32kB.

@robjtede robjtede added A-web project: actix-web B-semver-major breaking change requiring a major version bump B-semver-patch and removed B-semver-patch labels Feb 18, 2021
Copy link
Member

@robjtede robjtede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog entry but it's a reasonable change.

While technically the default limit for `JsonBody` is indeed 256kB when
called through `JsonBody::new`, in practice the limit is always set to
32kB for every context where `JsonBody` is used (via `JsonConfig`).
This is also consistent with the documentation of the
`JsonError::Overflow`, which mentions a default maximum of `32kB`.

This commit changes the default to also be `32kB` instead of `256kB`.
@SuperFluffy
Copy link
Contributor Author

Needs a changelog entry but it's a reasonable change.

Done.

@robjtede robjtede merged commit 3b93c62 into actix:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-major breaking change requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants