Skip to content

Commit 64895ae

Browse files
committed
Fix ASSETS binding showing up as a bucket in dashboard
1 parent 0b4260f commit 64895ae

File tree

4 files changed

+101
-464
lines changed

4 files changed

+101
-464
lines changed

packages/worker/dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "r2-explorer-dev-worker",
33
"devDependencies": {
4-
"wrangler": "^3.15.0"
4+
"wrangler": "^4.52.1"
55
},
66
"scripts": {
77
"deploy": "wrangler deploy"

packages/worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "r2-explorer",
3-
"version": "1.1.12",
3+
"version": "1.1.13",
44
"description": "A Google Drive Interface for your Cloudflare R2 Buckets",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

packages/worker/src/modules/server/getInfo.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@ export class GetInfo extends OpenAPIRoute {
1515
const buckets = [];
1616

1717
for (const [key, value] of Object.entries(c.env)) {
18-
// Type guard to check if value is an R2Bucket (must have list method)
19-
if (
20-
value &&
21-
typeof value === "object" &&
22-
"get" in value &&
23-
"put" in value &&
24-
"list" in value &&
25-
typeof value.get === "function" &&
26-
typeof value.put === "function" &&
27-
typeof value.list === "function"
28-
) {
18+
if (value.constructor.name === "R2Bucket") {
2919
buckets.push({ name: key });
3020
}
3121
}

0 commit comments

Comments
 (0)