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.
This commit is contained in:
user.email committed 2026-10-24 22:45:14 -07:00
1 parent bedb60a8a8
commit 65b92b654d
1 file changed
+8 -1
+8 -1
View File
@@ -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,