Skip to content

Commit b1b7ed0

Browse files
authored
spi-object: fix bug (#767)
1 parent c8385f3 commit b1b7ed0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/spi/spi-object/src/api/ci/object_ci_obj_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl ObjectCiObjApi {
9797
}
9898

9999
/// Batch fetch URL for temporary authorization of file
100-
#[oai(path = "/presign/batch_view", method = "get")]
100+
#[oai(path = "/presign/batch_view", method = "post")]
101101
async fn batch_presign_view_obj_url(&self, req: Json<ObjectPresignBatchViewReq>, ctx: TardisContextExtractor) -> TardisApiResult<HashMap<String, String>> {
102102
let funs = crate::get_tardis_inst();
103103
let url = object_obj_serv::batch_get_presign_obj_url(req.0.object_path, req.0.expire_sec, req.0.private, req.0.special, &funs, &ctx.0).await?;

backend/spi/spi-object/src/serv/s3/object_s3_obj_serv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub async fn presign_obj_url(
3030
ObjectObjPresignKind::Upload => client.object_create_url(object_path, exp_secs, bucket_name.as_deref()).await,
3131
ObjectObjPresignKind::Delete => client.object_delete_url(object_path, exp_secs, bucket_name.as_deref()).await,
3232
ObjectObjPresignKind::View => {
33-
if private.unwrap_or(true) {
33+
if private.unwrap_or(true) || special.unwrap_or(false) {
3434
client.object_get_url(object_path, exp_secs, bucket_name.as_deref()).await
3535
} else {
3636
let spi_bs = SpiBsServ::get_bs_by_rel(&ctx.ak, None, funs, ctx).await?;

0 commit comments

Comments
 (0)