From a3b57ebaff4644d5d3678ea7f27edb2b712c4252 Mon Sep 17 00:00:00 2001 From: MartinquaXD Date: Wed, 23 Oct 2024 10:25:27 +0000 Subject: [PATCH 1/2] Bump max request size limit to 30M --- src/api/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/mod.rs b/src/api/mod.rs index 9411c64..4cda559 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -2,6 +2,7 @@ use { crate::domain::solver::Solver, + axum::extract::DefaultBodyLimit, std::{future::Future, net::SocketAddr, sync::Arc}, tokio::sync::oneshot, }; @@ -26,6 +27,7 @@ impl Api { .layer( tower::ServiceBuilder::new().layer(tower_http::trace::TraceLayer::new_for_http()), ) + .layer(DefaultBodyLimit::max(30_000_000)) .with_state(Arc::new(self.solver)); let make_svc = observe::make_service_with_task_local_storage!(app); From 809b6799170ab38f6f3b2f597fe80fdb81ab1842 Mon Sep 17 00:00:00 2001 From: MartinquaXD Date: Wed, 23 Oct 2024 10:28:42 +0000 Subject: [PATCH 2/2] Actually disable request body limit altogether --- src/api/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index 4cda559..9e17035 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -27,7 +27,7 @@ impl Api { .layer( tower::ServiceBuilder::new().layer(tower_http::trace::TraceLayer::new_for_http()), ) - .layer(DefaultBodyLimit::max(30_000_000)) + .layer(DefaultBodyLimit::disable()) .with_state(Arc::new(self.solver)); let make_svc = observe::make_service_with_task_local_storage!(app);