fix: HeadObject returns 404 for deleted objects with versioning enabled (#1229)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
loverustfs
2025-12-22 20:43:00 +08:00
committed by GitHub
parent f17990f746
commit af5c0b13ef
3 changed files with 146 additions and 0 deletions
+7
View File
@@ -2443,6 +2443,13 @@ impl S3 for FS {
let info = store.get_object_info(&bucket, &key, &opts).await.map_err(ApiError::from)?;
if info.delete_marker {
if opts.version_id.is_none() {
return Err(S3Error::new(S3ErrorCode::NoSuchKey));
}
return Err(S3Error::new(S3ErrorCode::MethodNotAllowed));
}
if let Some(match_etag) = if_none_match {
if let Some(strong_etag) = match_etag.into_etag() {
if info