Skip to content

Commit

Permalink
fix: check for public bucket on info request (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenos authored Apr 5, 2024
1 parent 2af9fe9 commit 73a31f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/http/routes/object/getObjectInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 73a31f7

Please sign in to comment.