Skip to content

fix(storage): percent-encode object key in cdn purge urls - #384

Merged
Tr00d merged 1 commit into
supabase-community:masterfrom
fresh55:fix/storage-encode-purge-path
Aug 25, 2026
Merged

fix(storage): percent-encode object key in cdn purge urls#384
Tr00d merged 1 commit into
supabase-community:masterfrom
fresh55:fix/storage-encode-purge-path

Conversation

@fresh55

@fresh55 fresh55 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

closes #298

a ? or # in an object key was read as the start of a query string or fragment, so the purge hit the wrong path:

purgeCache("folder/a?b#c.png")

before  DELETE /cdn/bucket/folder/a?b
after   DELETE /cdn/bucket/folder/a%3Fb%23c.png

this percent-encodes each path segment, same as supabase/supabase-js#2545.

upstream only did this for the two purge urls, not for sign/render/object, so i kept it to the same two.

i didn't put the encoding in GetFinalPath because the upload methods return that value back to the caller as the key.

@Tr00d

Tr00d commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Well done, thanks @fresh55 for your contributions 👏

@Tr00d
Tr00d merged commit 710eb59 into supabase-community:master Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parity(storage): percent-encode object key/path in URL construction [from supabase-js]

2 participants