diff --git a/src/server/core.rs b/src/server/core.rs index 5d58c75..9e403af 100644 --- a/src/server/core.rs +++ b/src/server/core.rs @@ -3,6 +3,7 @@ use crate::server::compress; use crate::server::execute; use crate::server::judge; use crate::server::jwt; +use rocket::data::ByteUnit; use rocket::serde::{json::Json, Deserialize, Serialize}; use rocket::Build; use rocket::Config; @@ -35,10 +36,14 @@ fn info() -> Json { /// Get the Rocket instance pub fn rocket() -> Rocket { + let json_limit: ByteUnit = "10MB".parse().unwrap(); + let limits = Config::default().limits.limit("json", json_limit); + let server = rocket::build() .configure(Config { address: Ipv4Addr::new(0, 0, 0, 0).into(), port: server_port(), + limits, ..Config::default() }) .mount( diff --git a/src/server/judge.rs b/src/server/judge.rs index d977390..3ee84fa 100644 --- a/src/server/judge.rs +++ b/src/server/judge.rs @@ -82,8 +82,12 @@ pub async fn judge( let result = run_specs(wasm, submission.specs).await; let client = Client::new(); match client.post(&callback).json(&result).send().await { - Ok(_) => { - println!("Callback sent successfully. ({})", &callback); + Ok(res) => { + println!( + "Callback sent successfully. {} ({})", + res.status(), + &callback + ); } Err(e) => { println!("Error sending callback. {} ({})", e, &callback);