feat: Configure a 10GB body limit for uploads and enhance attachment processing with a 100MB image size cap and improved error handling.

This commit is contained in:
2026-03-04 00:34:21 +00:00
parent a8a05a0532
commit c370ce2f78
2 changed files with 13 additions and 8 deletions

View File

@@ -120,7 +120,8 @@ async fn main() {
.route("/__attachments/{id}", get(handlers::attachments::serve_attachment))
.nest("/__dungeon", handlers::router(&app_state)) // I'll create a single `handlers::router`
.with_state(app_state.clone())
.layer(axum::extract::DefaultBodyLimit::disable())
.layer(axum::extract::DefaultBodyLimit::max(10 * 1024 * 1024 * 1024)) // 10GB limit to be safe
.layer(tower_http::trace::TraceLayer::new_for_http());
let listener = TcpListener::bind(&addr).await.unwrap();