Skip to content

Commit

Permalink
feat: Increase default max body size to 50MB (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllexVeldman authored Aug 5, 2024
1 parent 7273bfc commit 8775faa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use askama::Template;
use async_trait::async_trait;
use axum::{
debug_handler,
extract::{FromRequestParts, Multipart, Path},
extract::{DefaultBodyLimit, FromRequestParts, Multipart, Path},
http::{header, request::Parts, HeaderMap},
response::{Html, IntoResponse},
routing::{get, post},
Expand Down Expand Up @@ -46,7 +46,10 @@ pub fn router() -> Router {
"/:registry/:namespace/:package/:filename",
get(download_package),
)
.route("/:registry/:namespace/", post(publish_package))
.route(
"/:registry/:namespace/",
post(publish_package).layer(DefaultBodyLimit::max(50 * 1024 * 1024)),
)
.layer(axum::middleware::from_fn(trace_middleware))
}

Expand Down

0 comments on commit 8775faa

Please sign in to comment.