limitting request body size

This commit is contained in:
Jakub Doka 2024-11-18 11:28:47 +01:00
parent f3879cb013
commit f527d61c1e
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -3,7 +3,7 @@ use {
argon2::{password_hash::SaltString, PasswordVerifier}, argon2::{password_hash::SaltString, PasswordVerifier},
axum::{ axum::{
body::Bytes, body::Bytes,
extract::Path, extract::{DefaultBodyLimit, Path},
http::{header::COOKIE, request::Parts}, http::{header::COOKIE, request::Parts},
response::{AppendHeaders, Html}, response::{AppendHeaders, Html},
}, },
@ -86,7 +86,8 @@ async fn amain() {
.as_millis(); .as_millis();
move || async move { id.to_string() } move || async move { id.to_string() }
}), }),
); )
.layer(DefaultBodyLimit::max(16 * 1024));
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
{ {