Repository navigation
fix(storage): apply metadata, headers, and cacheControl dedupe to uploadToSignedUrl - #2275
Merged
Merged
Conversation
…oadToSignedUrl uploadToSignedUrl was silently dropping three FileOptions that upload/update honor: metadata (no form field or x-metadata header), fileOptions.headers (loop never ran), and de-duping a caller-provided cacheControl field on FormData bodies (appended unconditionally). Mirrors the equivalent handling in uploadOrUpdate across all three body branches (Blob, FormData, raw) and the post-branch fileOptions.headers merge. Tests added alongside the existing uploadToSignedUrl body payload tests.
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
mandarini
approved these changes
Apr 24, 2026
5 of 6 tasks
This was referenced Apr 27, 2026
mandarini
pushed a commit
to supabase/ssr
that referenced
this pull request
Apr 27, 2026
This PR updates `@supabase/supabase-js` to v2.105.0. **Source**: supabase-js-stable-release --- ## Release Notes ## v2.105.0 ## 2.105.0 (2026-04-27) ### 🚀 Features - **auth:** add passkey support with WebAuthn registration, authentication, and management ([#2283](supabase/supabase-js#2283)) - **realtime:** Realtime deferred disconnect ([#2282](supabase/supabase-js#2282)) ### 🩹 Fixes - **postgrest:** narrow column types after not(column, is, null) ([#2264](supabase/supabase-js#2264)) - **realtime:** annotate Timer/Vsn getters to avoid deep phoenix imports ([#2284](supabase/supabase-js#2284)) - **storage:** apply metadata, headers, and cacheControl dedupe to uploadToSignedUrl ([#2275](supabase/supabase-js#2275)) - **storage:** forward duplex option for stream uploads via uploadToSignedUrl ([#2289](supabase/supabase-js#2289)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini - oniani1 This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
This was referenced Apr 27, 2026
This was referenced Apr 28, 2026
mandarini
pushed a commit
to supabase/supabase
that referenced
this pull request
May 6, 2026
This PR updates @supabase/*-js libraries to version 2.105.3. **Source**: supabase-js-stable-release **Changes**: - Updated @supabase/supabase-js to 2.105.3 - Updated @supabase/auth-js to 2.105.3 - Updated @supabase/realtime-js to 2.105.3 - Updated @supabase/postgest-js to 2.105.3 - Refreshed pnpm-lock.yaml --- ## Release Notes ## v2.105.3 ## 2.105.3 (2026-05-04) ### 🩹 Fixes - **auth:** narrow OAuth/CustomProvider types to fix downstream consumer typecheck ([#2326](supabase/supabase-js#2326)) ## v2.105.2 ## 2.105.2 (2026-05-04) ### 🩹 Fixes - **auth:** forward lockAcquireTimeout to SupabaseAuthClient ([#2309](supabase/supabase-js#2309)) - **auth:** add toJSON to WebAuthnError for correct JSON serialization ([#2317](supabase/supabase-js#2317)) - **misc:** widen enum-like unions with (string & {}) for forward compat ([#2303](supabase/supabase-js#2303)) - **misc:** reduce any usage across packages ([#2314](supabase/supabase-js#2314)) - **postgrest:** unify insert/upsert signatures ([#2315](supabase/supabase-js#2315)) ### ❤️ Thank You - Muzzaiyyan Hussain @MuzzaiyyanHussain ## v2.105.1 ## 2.105.1 (2026-04-28) ### 🩹 Fixes - **postgrest:** query reassignment regression ([#2292](supabase/supabase-js#2292)) - **realtime:** surface real Error on transport-level CHANNEL_ERROR ([#2299](supabase/supabase-js#2299)) ### ❤️ Thank You - Vaibhav @7ttp ## v2.105.0 ## 2.105.0 (2026-04-27) ### 🚀 Features - **auth:** add passkey support with WebAuthn registration, authentication, and management ([#2283](supabase/supabase-js#2283)) - **realtime:** Realtime deferred disconnect ([#2282](supabase/supabase-js#2282)) ### 🩹 Fixes - **postgrest:** narrow column types after not(column, is, null) ([#2264](supabase/supabase-js#2264)) - **realtime:** annotate Timer/Vsn getters to avoid deep phoenix imports ([#2284](supabase/supabase-js#2284)) - **storage:** apply metadata, headers, and cacheControl dedupe to uploadToSignedUrl ([#2275](supabase/supabase-js#2275)) - **storage:** forward duplex option for stream uploads via uploadToSignedUrl ([#2289](supabase/supabase-js#2289)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini - oniani1 This PR was created automatically. Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2274.
Summary
uploadToSignedUrlsilently drops threeFileOptionsthatupload/updatehonor viauploadOrUpdate:options.metadatais ignored. No form field on Blob/FormData bodies, nox-metadataheader on raw bodies.fileOptions.headersis ignored. ThesetHeadermerge loop was missing.cacheControlon caller-supplied FormData got appended unconditionally, producing two entries when the caller already added one.This patch mirrors the handling from
uploadOrUpdateacross all three body branches (Blob, FormData, raw) and adds the post-branch headers merge. No behavioral change for the content-type / cache-control defaults on raw bodies, nor for the fallbacks when the options are absent.Test plan
uploadToSignedUrl with metadata (Blob body). FormData includes ametadatafield.uploadToSignedUrl with metadata (FormData body). Caller's FormData keeps its own entries and gainsmetadata.uploadToSignedUrl with metadata (raw body sends x-metadata header). Base64-encoded JSON in thex-metadatarequest header.uploadToSignedUrl passes headers.fileOptions.headerskeys reach the outgoing request.uploadToSignedUrl does not duplicate cacheControl when caller FormData has one. Caller's7200wins, SDK's3600default is skipped.All 10
uploadToSignedUrltests pass, including the 5 new ones. The fix was also reproduced end-to-end against a localsupabase/storageDocker server.