httpd: Increase body size limit for /projects/*

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-10-03 11:59:11 +02:00
committed by cloudhead
parent cd4e9870bf
commit 36f4cb4961
+3 -1
View File
@@ -1,6 +1,6 @@
use std::collections::{BTreeMap, HashMap};
use axum::extract::State;
use axum::extract::{DefaultBodyLimit, State};
use axum::handler::Handler;
use axum::http::{header, HeaderValue};
use axum::response::IntoResponse;
@@ -28,6 +28,7 @@ use crate::api::{self, CobsQuery, Context, DataUri, PaginationQuery};
use crate::axum_extra::{Path, Query};
const CACHE_1_HOUR: &str = "public, max-age=3600, must-revalidate";
const MAX_BODY_LIMIT: usize = 4_194_304;
pub fn router(ctx: Context) -> Router {
Router::new()
@@ -68,6 +69,7 @@ pub fn router(ctx: Context) -> Router {
patch(patch_update_handler).get(patch_handler),
)
.with_state(ctx)
.layer(DefaultBodyLimit::max(MAX_BODY_LIMIT))
}
/// List all projects.