fix get s3 body bytes use store_all_unlimited

This commit is contained in:
weisd
2025-01-15 21:45:23 +08:00
parent c62ceef1d3
commit 821ff036be
3 changed files with 14 additions and 8 deletions
+7 -2
View File
@@ -33,8 +33,13 @@ impl Operation for UpdateGroupMembers {
async fn call(&self, req: S3Request<Body>, _params: Params<'_, '_>) -> S3Result<S3Response<(StatusCode, Body)>> {
warn!("handle UpdateGroupMembers");
let Some(body) = req.input.bytes() else {
return Err(s3_error!(InvalidRequest, "get body failed"));
let mut input = req.input;
let body = match input.store_all_unlimited().await {
Ok(b) => b,
Err(e) => {
warn!("get body failed, e: {:?}", e);
return Err(s3_error!(InvalidRequest, "get body failed"));
}
};
let args: GroupAddRemove = serde_json::from_slice(&body)
+7 -2
View File
@@ -32,8 +32,13 @@ impl Operation for AddServiceAccount {
};
let _is_owner = true; // 先按true处理,后期根据请求决定。
let Some(body) = req.input.bytes() else {
return Err(s3_error!(InvalidRequest, "get body failed"));
let mut input = req.input;
let body = match input.store_all_unlimited().await {
Ok(b) => b,
Err(e) => {
warn!("get body failed, e: {:?}", e);
return Err(s3_error!(InvalidRequest, "get body failed"));
}
};
let mut create_req: AddServiceAccountReq =
-4
View File
@@ -53,10 +53,6 @@ impl Operation for AddUser {
}
};
// let Some(body) = req.input.bytes() else {
// return Err(s3_error!(InvalidRequest, "get body failed"));
// };
// let body_bytes = decrypt_data(input_cred.secret_key.expose().as_bytes(), &body)
// .map_err(|e| S3Error::with_message(S3ErrorCode::InvalidArgument, format!("decrypt_data err {}", e)))?;