Skip to content

ref: Limit request instead of multipart stream#5827

Merged
elramen merged 2 commits into
masterfrom
ps3
Apr 16, 2026
Merged

ref: Limit request instead of multipart stream#5827
elramen merged 2 commits into
masterfrom
ps3

Conversation

@elramen

@elramen elramen commented Apr 13, 2026

Copy link
Copy Markdown
Member

Limit the request body usingRequestBodyLimitLayer instead of DefaultBodyLimit which doesn't support streaming requests. Remove the overall multipart stream size limit as it becomes obsolete with this change.

Fixes https://linear.app/getsentry/issue/INGEST-760/playstation-body-limit-mismatch

@linear-code

linear-code Bot commented Apr 13, 2026

Copy link
Copy Markdown

@elramen elramen marked this pull request as ready for review April 13, 2026 15:36
@elramen elramen requested a review from a team as a code owner April 13, 2026 15:36

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing DefaultBodyLimit breaks raw minidump uploads over 2MiB
    • Restored DefaultBodyLimit::disable() on the minidump route so the raw Bytes extractor no longer enforces axum’s 2 MiB default and correctly relies on the configured request body limit layer.

Create PR

Or push these changes by commenting:

@cursor push e673fd0694
Preview (e673fd0694)
diff --git a/relay-server/src/endpoints/minidump.rs b/relay-server/src/endpoints/minidump.rs
--- a/relay-server/src/endpoints/minidump.rs
+++ b/relay-server/src/endpoints/minidump.rs
@@ -1,5 +1,5 @@
 use axum::RequestExt;
-use axum::extract::Request;
+use axum::extract::{DefaultBodyLimit, Request};
 use axum::response::IntoResponse;
 use axum::routing::{MethodRouter, post};
 use bytes::Bytes;
@@ -283,6 +283,7 @@
 
 pub fn route(config: &Config) -> MethodRouter<ServiceState> {
     post(handle)
+        .route_layer(DefaultBodyLimit::disable())
         .route_layer(RequestBodyLimitLayer::new(config.max_attachments_size()))
         .route_layer(axum::middleware::from_fn(middlewares::content_length))
 }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 462f13f. Configure here.

Comment thread relay-server/src/endpoints/minidump.rs
Comment thread relay-server/src/endpoints/minidump.rs
@elramen elramen requested a review from jjbayer April 14, 2026 12:24
Comment thread relay-server/src/endpoints/attachments.rs
Comment thread relay-server/src/endpoints/minidump.rs
Comment thread relay-server/src/endpoints/attachments.rs
@elramen elramen requested a review from jjbayer April 16, 2026 13:44
@elramen elramen added this pull request to the merge queue Apr 16, 2026
Merged via the queue into master with commit 806aeb5 Apr 16, 2026
30 checks passed
@elramen elramen deleted the ps3 branch April 16, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants