Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File name in signed URLs is not URI-encoded #1011

Open
2 tasks done
leonardo-panseri opened this issue Dec 5, 2024 · 0 comments · May be fixed by supabase/storage-py#324
Open
2 tasks done

File name in signed URLs is not URI-encoded #1011

leonardo-panseri opened this issue Dec 5, 2024 · 0 comments · May be fixed by supabase/storage-py#324
Labels
bug Something isn't working

Comments

@leonardo-panseri
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The supabase.storage.from_().create_signed_url() method returns an invalid URL if the file name contains any character that should be URI-encoded.

To Reproduce

  1. Create a bucket named my-bucket
  2. Upload a file named my file.txt to the bucket
  3. Execute this script with the Python client:
response = supabase.storage.from_("my-bucket").create_signed_url("my file.txt", 120)
print(response["signedURL"])

The output is the invalid URL:

https://<supabase_url>/storage/v1/object/sign/my-bucket/my file.txt?token=<token>

Expected behavior

The file name should be URI-encoded before using it to build the URL, for the previous example I expect an output like:

https://<supabase_url>/storage/v1/object/sign/my-bucket/my%20file.txt?token=<token>
@leonardo-panseri leonardo-panseri added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant