httpd: Increase body size limit for `/projects/*`

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez 2023-09-27 13:09:10 +02:00 committed by cloudhead
parent 154566f8ef
commit 313fc1315d
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

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.