Skip to content

Commit 5a39e22

Browse files
author
Devdutt Shenoi
authored
fix: limit JSON payload size to 10MB (#1133)
Since #1100 we are using the Json extractor, which uses JsonConfig, not PayloadConfig
1 parent a140d37 commit 5a39e22

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/handlers/http/modal/ingest_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl IngestServer {
249249
web::put()
250250
.to(ingestor_logstream::put_stream)
251251
.authorize_for_stream(Action::CreateStream),
252-
),
252+
)
253253
)
254254
.service(
255255
// GET "/logstream/{logstream}/info" ==> Get info for given log stream

src/handlers/http/modal/query_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl QueryServer {
275275
.to(querier_logstream::delete)
276276
.authorize_for_stream(Action::DeleteStream),
277277
)
278-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
278+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
279279
)
280280
.service(
281281
// GET "/logstream/{logstream}/info" ==> Get info for given log stream

src/handlers/http/modal/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl Server {
318318
.to(logstream::delete)
319319
.authorize_for_stream(Action::DeleteStream),
320320
)
321-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
321+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
322322
)
323323
.service(
324324
// GET "/logstream/{logstream}/info" ==> Get info for given log stream
@@ -404,7 +404,7 @@ impl Server {
404404
.to(ingest::ingest)
405405
.authorize_for_stream(Action::Ingest),
406406
)
407-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE))
407+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE))
408408
}
409409

410410
// /v1/logs endpoint to be used for OTEL log ingestion only
@@ -417,7 +417,7 @@ impl Server {
417417
.to(ingest::handle_otel_logs_ingestion)
418418
.authorize_for_stream(Action::Ingest),
419419
)
420-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
420+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
421421
)
422422
.service(
423423
web::resource("/metrics")
@@ -426,7 +426,7 @@ impl Server {
426426
.to(ingest::handle_otel_metrics_ingestion)
427427
.authorize_for_stream(Action::Ingest),
428428
)
429-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
429+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
430430
)
431431
.service(
432432
web::resource("/traces")
@@ -435,7 +435,7 @@ impl Server {
435435
.to(ingest::handle_otel_traces_ingestion)
436436
.authorize_for_stream(Action::Ingest),
437437
)
438-
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
438+
.app_data(web::JsonConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
439439
)
440440
}
441441

0 commit comments

Comments
 (0)