From f527d61c1ed8d6fe647a3d883f853e62bb456fea Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Mon, 18 Nov 2024 11:28:47 +0100 Subject: [PATCH] limitting request body size --- depell/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/depell/src/main.rs b/depell/src/main.rs index 0b234e0..29fda66 100644 --- a/depell/src/main.rs +++ b/depell/src/main.rs @@ -3,7 +3,7 @@ use { argon2::{password_hash::SaltString, PasswordVerifier}, axum::{ body::Bytes, - extract::Path, + extract::{DefaultBodyLimit, Path}, http::{header::COOKIE, request::Parts}, response::{AppendHeaders, Html}, }, @@ -86,7 +86,8 @@ async fn amain() { .as_millis(); move || async move { id.to_string() } }), - ); + ) + .layer(DefaultBodyLimit::max(16 * 1024)); #[cfg(feature = "tls")] {