supabase-py icon indicating copy to clipboard operation
supabase-py copied to clipboard

Extra / in storage get_public_url() method

Open justinbarak opened this issue 2 years ago • 6 comments

Describe the bug There is an extra forward slash returned in the get_public_url method.

To Reproduce Steps to reproduce the behavior:

  1. Instantiate SupabaseStorageClient
  2. Use client.from_({bucket}).get_public_url({filename})
  3. Result is 'https://{database}.supabase.co/storage/v1//object/public/{bucket}/{filename}'

Expected behavior 'https://{database}.supabase.co/storage/v1/object/public/{bucket}/{filename}' which matches what you get from the supabase website console when clicking the button for public_url.

Desktop (please complete the following information):

  • OS: Windows11
  • Python: 3.9.9
  • Supabase version: 0.5.8

Additional context Deleting the extra / between v1 and object does give the correct url.

justinbarak avatar Aug 27 '22 15:08 justinbarak

Can you use this package for Supabase storage ?

ZetiMente avatar Aug 28 '22 17:08 ZetiMente

Can you use this package for Supabase storage ?

I think that's how you're supposed to access it via python. It builds off of another package, which specifically recommends using this 'master' package to interact with the storage api.

justinbarak avatar Aug 28 '22 18:08 justinbarak

Would you like to open a bug-fix PR? You'd just need to remove the / before object on this line I think. (It looks like base_url has a trailing /, looking at the implementation of create_signed_url above this method).

anand2312 avatar Sep 03 '22 02:09 anand2312

Would you like to open a bug-fix PR? You'd just need to remove the / before object on this line I think. (It looks like base_url has a trailing /, looking at the implementation of create_signed_url above this method).

Done! Feel free to review and approve. Thanks for finding the line in issue!!

justinbarak avatar Sep 07 '22 17:09 justinbarak

@anand2312 Can you review and approve?

justinbarak avatar Sep 15 '22 18:09 justinbarak

Any way to get this pull request integrated? It is the most minor of corrections and won't cause issues.

justinbarak avatar Sep 23 '22 18:09 justinbarak

Merged the PR, this will be updated here in the next version. Thanks for your contribution!

anand2312 avatar Oct 10 '22 15:10 anand2312