Browse Source

main: set JSON body limit to 50M

* This can happen during import of old backups. Customizations should be
  done in frontend reverse-proxy.
master
Peter Cai 2 years ago
parent
commit
4a75dfd225
  1. 3
      src/main.rs

3
src/main.rs

@ -30,7 +30,7 @@ pub use db::*;
use diesel::prelude::*;
use dotenv::dotenv;
use rocket::Rocket;
use rocket::config::{Config, Environment, Value};
use rocket::config::{Config, Environment, Value, Limits};
use std::collections::HashMap;
use std::env;
@ -72,6 +72,7 @@ fn get_environment() -> Environment {
fn build_config() -> Config {
Config::build(get_environment())
.extra("databases", db_config())
.limits(Limits::new().limit("json", 50 * 1024 * 1024))
.finalize()
.unwrap()
}

Loading…
Cancel
Save