Skip to content

Commit

Permalink
fix: increased request payload size from 2MB to 10MB
Browse files Browse the repository at this point in the history
  • Loading branch information
fevral13 committed Feb 27, 2024
1 parent e2d6c9c commit fd5eb15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "evalrs"
version = "0.1.5"
version = "0.1.6"
authors = ["Serhii Zavadskyi <[email protected]>"]
edition = "2021"

Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use actix_web::{middleware::Logger, web::Data, App, HttpServer};
use actix_web::{middleware::Logger, web::Data, web::JsonConfig, App, HttpServer};
use log::debug;

use crate::app_state::AppState;
Expand All @@ -16,6 +16,8 @@ mod settings;
mod templates;
mod tests;

const DEFAULT_LIMIT: usize = 10_485_760; // 10MB

#[actix_web::main]
async fn main() -> std::io::Result<()> {
env_logger::init();
Expand All @@ -28,6 +30,7 @@ async fn main() -> std::io::Result<()> {

let mut server = HttpServer::new(move || {
App::new()
.app_data(JsonConfig::default().limit(DEFAULT_LIMIT))
.app_data(_app_state.clone())
.wrap(Logger::default())
.service(crate::handlers::evaluate_script)
Expand Down

0 comments on commit fd5eb15

Please sign in to comment.