upload limit
This commit is contained in:
@@ -175,6 +175,8 @@ pub fn create_router(state: AppState) -> Router<()> {
|
||||
}),
|
||||
);
|
||||
|
||||
let upload_limit = state.config.upload_body_limit_bytes;
|
||||
|
||||
Router::new()
|
||||
.merge(download_routes)
|
||||
.merge(protected_routes)
|
||||
@@ -183,7 +185,9 @@ pub fn create_router(state: AppState) -> Router<()> {
|
||||
.route("/api/health", get(health::health_check))
|
||||
.with_state(state)
|
||||
.layer(cors)
|
||||
.layer(DefaultBodyLimit::max(128 * 1024 * 1024))
|
||||
.layer(DefaultBodyLimit::max(
|
||||
usize::try_from(upload_limit).unwrap_or(usize::MAX),
|
||||
))
|
||||
.layer(
|
||||
TraceLayer::new_for_http()
|
||||
.make_span_with(DefaultMakeSpan::new().level(tracing::Level::INFO))
|
||||
|
||||
Reference in New Issue
Block a user