mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 17:58:22 +00:00
fix(s3): accept empty put without content length (#6849)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -656,7 +656,7 @@ impl DefaultObjectUsecase {
|
||||
req_info.object = Some(fpath.clone());
|
||||
req_info.version_id = None;
|
||||
}
|
||||
let entry_size = f.header().size().unwrap_or_default();
|
||||
let entry_size = f.effective_size();
|
||||
validate_put_object_extract_entry_size(&fpath, entry_size, extract_limits)?;
|
||||
total_unpacked_size = total_unpacked_size
|
||||
.checked_add(entry_size)
|
||||
|
||||
@@ -2273,6 +2273,7 @@ mod tests {
|
||||
let s3_config = rustfs_s3_config();
|
||||
|
||||
assert!(s3_config.normalize_forward_slash_path);
|
||||
assert!(s3_config.normalize_content_length);
|
||||
assert!(s3_config.enable_sig_v2);
|
||||
assert!(s3_config.sig_v4_allowed_services.iter().any(|service| service == "s3"));
|
||||
assert!(s3_config.sig_v4_allowed_services.iter().any(|service| service == "sts"));
|
||||
|
||||
Reference in New Issue
Block a user