Skip to content

Use axum::DefaultBodyLimit for request payload size limiting #5904

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

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Jan 10, 2023

The DefaultBodyLimit is 2 MB by default but can be adjusted per route. This PR changes our code to use the default limit, except for the publish endpoint which uses a custom 128 MB limit, like before.

The previous approach used a custom check_content_length() function that we imported from conduit, but since axum has this functionality essentially built-in we should migrate to that.

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Jan 10, 2023
The `DefaultBodyLimit` is 2 MB by default but can be adjusted per route. This commit changes our code to use the default limit, except for the publish endpoint which uses a custom 128 MB limit, like before.
@Turbo87 Turbo87 merged commit c4ee89c into rust-lang:master Jan 10, 2023
@Turbo87 Turbo87 deleted the body-limit branch January 10, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant