Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
httpd: Increase body size limit for /projects/*
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Martinez <[email protected]>
  • Loading branch information
sebastinez authored and cloudhead committed Oct 3, 2023
1 parent 154566f commit 313fc13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion radicle-httpd/src/api/v1/projects.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 313fc13

Please sign in to comment.