Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Revert "fix(storage): Supabase signed URLs — prepend /storage/v1 (#2565)"

Garry Tan10b5746053c8
diff --git a/src/core/storage/supabase.ts b/src/core/storage/supabase.ts
index ef82d4d75c..ace1fb7f88 100644
--- a/src/core/storage/supabase.ts
+++ b/src/core/storage/supabase.ts
@@ -195,14 +195,7 @@ export class SupabaseStorage implements StorageBackend {
throw new Error(`Supabase signed URL failed: ${res.status} ${body}`);
}
const result = await res.json() as { signedURL: string };
- // Supabase returns `signedURL` relative to the Storage API root, e.g.
- // "/object/sign/<bucket>/<path>?token=...". Prepend projectUrl + "/storage/v1"
- // (not just projectUrl) or the link 404s. Tolerate an already-absolute URL or a
- // value that already carries the /storage/v1 prefix.
- const signed = result.signedURL;
- if (/^https?:\/\//.test(signed)) return signed;
- if (signed.startsWith('/storage/v1')) return `${this.projectUrl}${signed}`;
- return `${this.projectUrl}/storage/v1${signed.startsWith('/') ? '' : '/'}${signed}`;
+ return `${this.projectUrl}${result.signedURL}`;
}
async getUrl(path: string): Promise<string> {