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

router: Remove obsolete DefaultBodyLimit override #10197

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/router.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use axum::extract::DefaultBodyLimit;
use axum::response::IntoResponse;
use axum::routing::{delete, get, post, put};
use axum::{Json, Router};
Expand All @@ -12,8 +11,6 @@ use crate::openapi::BaseOpenApi;
use crate::util::errors::not_found;
use crate::Env;

const MAX_PUBLISH_CONTENT_LENGTH: usize = 128 * 1024 * 1024; // 128 MB

pub fn build_axum_router(state: AppState) -> Router<()> {
let (router, openapi) = BaseOpenApi::router()
.routes(routes!(
Expand All @@ -26,9 +23,7 @@ pub fn build_axum_router(state: AppState) -> Router<()> {
// Routes used by `cargo`
.route(
"/api/v1/crates/new",
put(krate::publish::publish)
.layer(DefaultBodyLimit::max(MAX_PUBLISH_CONTENT_LENGTH))
.get(krate::metadata::show_new),
put(krate::publish::publish).get(krate::metadata::show_new),
)
.route(
"/api/v1/crates/:crate_id/owners",
Expand Down