fix(rustfs):get_object_legal_hold default response

This commit is contained in:
weisd
2025-06-04 19:16:57 +08:00
parent 541b812bb4
commit 906cc5ffd7
+20 -4
View File
@@ -2105,13 +2105,15 @@ impl S3 for FS {
None
};
if legal_hold.is_none() {
return Err(s3_error!(InvalidRequest, "Object does not have legal hold"));
}
let status = if let Some(v) = legal_hold {
v
} else {
ObjectLockLegalHoldStatus::OFF.to_string()
};
Ok(S3Response::new(GetObjectLegalHoldOutput {
legal_hold: Some(ObjectLockLegalHold {
status: Some(ObjectLockLegalHoldStatus::from(legal_hold.unwrap_or_default())),
status: Some(ObjectLockLegalHoldStatus::from(status)),
}),
}))
}
@@ -2173,6 +2175,20 @@ impl S3 for FS {
request_charged: Some(RequestCharged::from_static(RequestCharged::REQUESTER)),
}))
}
async fn get_object_retention(
&self,
_req: S3Request<GetObjectRetentionInput>,
) -> S3Result<S3Response<GetObjectRetentionOutput>> {
Err(s3_error!(NotImplemented, "GetObjectRetention is not implemented yet"))
}
async fn put_object_retention(
&self,
_req: S3Request<PutObjectRetentionInput>,
) -> S3Result<S3Response<PutObjectRetentionOutput>> {
Err(s3_error!(NotImplemented, "PutObjectRetention is not implemented yet"))
}
}
#[allow(dead_code)]