From 73a31f7cee98fac188413a9a7c2b6c14532e227d Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Fri, 5 Apr 2024 17:52:11 +0100 Subject: [PATCH] fix: check for public bucket on info request (#447) --- src/http/routes/object/getObjectInfo.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/http/routes/object/getObjectInfo.ts b/src/http/routes/object/getObjectInfo.ts index 45c8bc75..31c23389 100644 --- a/src/http/routes/object/getObjectInfo.ts +++ b/src/http/routes/object/getObjectInfo.ts @@ -38,6 +38,9 @@ async function requestHandler( let obj: Obj if (publicRoute) { + await request.storage.asSuperUser().findBucket(bucketName, 'id', { + isPublic: true, + }) obj = await request.storage.asSuperUser().from(bucketName).findObject(objectName, 'id,version') } else { obj = await request.storage.from(bucketName).findObject(objectName, 'id,version')