fix(storage): do not rewrite signed URL to render endpoint for empty transform object - #2162
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis pull request adds a hasTransform check to createSignedUrl so an empty transform object (e.g., {}) is treated as no transform. The change conditions sending transform in the POST payload and selecting the returned signed URL path on the presence of an actual transform object, preventing empty transforms from switching the endpoint to the render/image path. Sequence Diagram(s)(omitted) Assessment against linked issues
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
Passing
{ transform: {} }tocreateSignedUrlincorrectly rewrote the returned URL from/object/sign/to/render/image/sign/, causing a 422 on non-image files. The server already treats an empty transform object as "no transformation" and returns/object/sign/. The client-side normalization (added to handle older storage-api versions) was triggering on{}because it is truthy in JavaScript. Fixed by checking that the transform object has at least one key before treating it as a transform request.Fixes: #2159