index : sfrs

A Standard Notes Sync Server written in Rust

diff options
context:
space:
mode:
authorPeter Cai <[email protected]>2020-02-24 12:06:41 +0800
committerPeter Cai <[email protected]>2020-02-24 12:07:48 +0800
commit4a75dfd2259c7ddac68b98f92749001fd9edde5a (patch)
tree35f8066acabef14335330f9b0f87466381235f1b
parentc4e489da563ef88b5e888b166c765f86cfc83848 (diff)
downloadsfrs-4a75dfd2259c7ddac68b98f92749001fd9edde5a.tar.gz
main: set JSON body limit to 50M
* This can happen during import of old backups. Customizations should be done in frontend reverse-proxy.
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 58e3a31..b750778 100644
--- a/src/main.rs
+++ b/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()
}