From 65b92b654dc2827b13ecffac1aa297d998be0eb5 Mon Sep 17 00:00:00 2001 From: "user.email" Date: Sat, 24 Oct 2026 22:45:14 -0700 Subject: [PATCH] fix(rust-volume-server): skip native size pre-check for multipart uploads The limit applies to the file part, not the multipart envelope; multipart uploads are delegated so the backend measures the right bytes. --- rust/volume_server/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rust/volume_server/src/main.rs b/rust/volume_server/src/main.rs index 3b2b65bb5c..c607e58e19 100644 --- a/rust/volume_server/src/main.rs +++ b/rust/volume_server/src/main.rs @@ -527,7 +527,14 @@ fn try_handle_native_http( } if let Some(limit_bytes) = config.and_then(|c| c.file_size_limit_bytes) { - if parsed.content_length > limit_bytes { + // For multipart uploads content_length includes envelope bytes; + // the size limit applies to the file part, so let the backend check. + let is_multipart = parsed + .content_type + .as_deref() + .map(|v| v.trim_start().to_ascii_lowercase().starts_with("multipart/")) + .unwrap_or(false); + if !is_multipart && parsed.content_length > limit_bytes { consume_bytes(stream, parsed.header_len + parsed.content_length)?; write_native_http_response( stream,