Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,18 @@ fn usage(store: &State<Store>, api_key: ApiKeyPresent, email: String) -> Json<Us

#[launch]
async fn rocket() -> _ {
let rocket = rocket::build();
// Raise Rocket's default body-size limits so chunked uploads up to
// CHUNK_SIZE do not trip "Data limit reached while reading the request
// body". `data.open((end - start).bytes())` already caps the per-request
// read; this lifts the framework-level cap that runs before it.
// A small headroom above CHUNK_SIZE leaves room for HTTP overhead.
let limits = rocket::data::Limits::default()
.limit("bytes", (CHUNK_SIZE + 1024 * 1024).bytes())
.limit("data-form", (CHUNK_SIZE + 1024 * 1024).bytes())
.limit("file", (CHUNK_SIZE + 1024 * 1024).bytes());

let figment = rocket::Config::figment().merge(("limits", limits));
let rocket = rocket::custom(figment);
let config = rocket
.figment()
.extract::<CryptifyConfig>()
Expand Down