Browse Source

Only set upload response name when needle HasName matching Go

Go checks reqNeedle.HasName() before setting ret.Name. Rust always set
the name from the filename variable, which could return the fid portion
of the path as the name for raw PUT requests without a filename.
rust-volume-server
Chris Lu 2 days ago
parent
commit
b79894d604
  1. 7
      seaweed-volume/src/server/handlers.rs

7
seaweed-volume/src/server/handlers.rs

@ -2311,8 +2311,13 @@ pub async fn post_handler(
// H2: Use Content-MD5 computed from original uncompressed data
let content_md5_value = original_content_md5;
// Match Go: always include contentMd5 in response JSON and header
// Go only sets ret.Name when reqNeedle.HasName()
let result = UploadResult {
name: filename.clone(),
name: if n.has_name() {
filename.clone()
} else {
String::new()
},
size: original_data_size, // H3: use original size, not compressed
etag: n.etag(),
mime: mime_type.clone(),

Loading…
Cancel
Save