From f098e118edb978e49c3fdbc24ca569035a1a529a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 18 Mar 2026 11:27:32 -0700 Subject: [PATCH] fix has_resize_ops to check width/height > 0 instead of is_some() Go's shouldResizeImages condition is `width > 0 || height > 0`, so `?width=0` correctly evaluates to false. Rust was using `is_some()` which made `?width=0` evaluate to true, unnecessarily disabling streaming reads for those requests. --- seaweed-volume/src/server/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seaweed-volume/src/server/handlers.rs b/seaweed-volume/src/server/handlers.rs index 42b82ddee..ccdfd0b62 100644 --- a/seaweed-volume/src/server/handlers.rs +++ b/seaweed-volume/src/server/handlers.rs @@ -977,7 +977,7 @@ async fn get_or_head_handler_inner( let ext = extract_extension_from_path(&path); // Go checks resize and crop extensions separately: resize supports .webp, crop does not. let has_resize_ops = - is_image_resize_ext(&ext) && (query.width.is_some() || query.height.is_some()); + is_image_resize_ext(&ext) && (query.width.unwrap_or(0) > 0 || query.height.unwrap_or(0) > 0); // Go's shouldCropImages (L410) requires x2 > x1 && y2 > y1 (x1/y1 default 0). // Only disable streaming when a real crop will actually happen. let has_crop_ops = is_image_crop_ext(&ext) && {