supabase-js
supabase-js copied to clipboard
`createSignedUploadUrl` does not validate mime type.
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
If I create a signed upload url using createSignedUploadUrl and upload a file with a different mime type, it does not stop.
E.g.,
1- create signedUploadUrl for file.md
2- upload test.pdf buffer with Content-Type: application/pdf in headers
✅ Successfully uploaded
1- create signedUploadUrl for file.md
2- upload test.pdf buffer with Content-Type: text/markdown in headers
✅ Successfully uploaded
To Reproduce
Do following on the above two test cases:
- create SignedUploadUrl
- Upload file
Expected behavior
It should give error that mime type does not match.
Screenshots
NA
System information
- OS: macOS
- Version of supabase-js: 2.44.4
- Version of Node.js: NA (using cloudflare worker)
I made a PR for this issue : https://github.com/supabase/storage-js/pull/210
I recognize this is a bug, but it needs to be fixed on the server side. There's an issue open here: https://github.com/supabase/storage/issues/639 I'll escalate with the team!
Thank you very much for your contribution!