You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a bucket called "public", using the download command in the UI and doing a storage.from.download from the API will return 404 for any files.
Public URL works as expected if a public bucket.
GET https://instanceid.supabase.co/storage/v1/object/public/shot.jpg404
Using UI download from menu:
NOTE adding public/ to the path in .download does work if bucket is public.....
GET https://instanceid.supabase.co/storage/v1/object/public/public/shot.jpgWorks (if bucket public)
If I read that correctly, a url route with public in it automatically gets treated as a request for a different interface than any other name. So a bucket named "public" can not work. This seems hard to fix without major change to the storage protocol.
Probably easier to not allow buckets to be named public in the bucket creation process and deal with existing buckets on a case by case basis (but is difficult as buckets cannot be renamed at least for the api I don't believe).
To Reproduce
Create a public bucket named public. Upload a file. Click download from UI. Get 404 error.
Create a public bucket named test. Upload same file. Click on download from UI it works.
EDIT: creating a private bucket named "public" also fails.
Expected behavior
A public bucket named "public" should work, or error on creation, or at least be documented not to work.
System information
Current supabase.js and Supabase instance.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
GaryAustin1
changed the title
A public bucket named "public" will fail download of files with 404.
A bucket named "public" will fail download of files with 404.
Mar 6, 2022
Bug report
If you create a bucket called "public", using the download command in the UI and doing a storage.from.download from the API will return 404 for any files.
Public URL works as expected if a public bucket.
Probably related:
#22
Describe the bug
using
GET
https://instanceid.supabase.co/storage/v1/object/public/shot.jpg
404Using UI download from menu:
NOTE adding public/ to the path in .download does work if bucket is public.....
GET
https://instanceid.supabase.co/storage/v1/object/public/public/shot.jpg
Works (if bucket public)Edit:
Issue seems to be this code:
https://github.com/supabase/storage-api/blob/1e55aa38e8572dfb399527e033edfa8e86f86a01/src/routes/object/getPublicObject.ts#L38
If I read that correctly, a url route with public in it automatically gets treated as a request for a different interface than any other name. So a bucket named "public" can not work. This seems hard to fix without major change to the storage protocol.
Probably easier to not allow buckets to be named public in the bucket creation process and deal with existing buckets on a case by case basis (but is difficult as buckets cannot be renamed at least for the api I don't believe).
To Reproduce
Create a public bucket named public. Upload a file. Click download from UI. Get 404 error.
Create a public bucket named test. Upload same file. Click on download from UI it works.
EDIT: creating a private bucket named "public" also fails.
Expected behavior
A public bucket named "public" should work, or error on creation, or at least be documented not to work.
System information
Current supabase.js and Supabase instance.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: