Skip to content

Commit 84e3dd9

Browse files
authored
Increase the request body payload size limit to 10MB
Fixes #271
1 parent 70566f6 commit 84e3dd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod validator;
5555
use option::CONFIG;
5656

5757
// Global configurations
58-
const MAX_EVENT_PAYLOAD_SIZE: usize = 1024000;
58+
const MAX_EVENT_PAYLOAD_SIZE: usize = 10240000;
5959
const API_BASE_PATH: &str = "/api";
6060
const API_VERSION: &str = "v1";
6161

@@ -261,7 +261,11 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
261261
// POST "/query" ==> Get results of the SQL query passed in request body
262262
.service(web::resource(query_path()).route(web::post().to(handlers::event::query)))
263263
// POST "/ingest" ==> Post logs to given log stream based on header
264-
.service(web::resource(ingest_path()).route(web::post().to(handlers::event::ingest)))
264+
.service(
265+
web::resource(ingest_path())
266+
.route(web::post().to(handlers::event::ingest))
267+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
268+
)
265269
.service(
266270
// logstream API
267271
web::resource(logstream_path("{logstream}"))

0 commit comments

Comments
 (0)