From 57232ad786db80801de5d24131930bd2369f0cd7 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 01:41:41 -0700 Subject: [PATCH] Fix raw body POST: only parse multipart when Content-Type contains form-data --- seaweed-volume/src/server/handlers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seaweed-volume/src/server/handlers.rs b/seaweed-volume/src/server/handlers.rs index ad20c56fc..d12604965 100644 --- a/seaweed-volume/src/server/handlers.rs +++ b/seaweed-volume/src/server/handlers.rs @@ -1896,9 +1896,9 @@ pub async fn post_handler( .unwrap_or("") .to_string(); - // Go only parses multipart form-data for POST requests. + // Go only parses multipart form-data for POST requests with form-data content type. let should_parse_multipart = - method == Method::POST && (content_type_str.is_empty() || content_type_str.contains("form-data")); + method == Method::POST && content_type_str.contains("form-data"); // Validate multipart/form-data has a boundary if should_parse_multipart && !content_type_str.contains("boundary=") {