Conversation
relative_path_to_parts parsed the object path as a URL, so a '?' or '#'
started a query string or fragment and everything after it was dropped.
upload('folder/what?.png') silently wrote to the key 'folder/what'.
'?' is a valid object key character in Supabase Storage.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
What
relative_path_to_partsnow escapes?and#before handing the path toyarl.URL. They stay part of the path, and yarl encodes them as%3F/%23when it builds the request URL.Before:
upload("folder/what?.png")→.../object/bucket/folder/whatAfter:
upload("folder/what?.png")→.../object/bucket/folder/what%3F.pngWhy this approach
The change is kept to the smallest possible scope. All other parsing behavior is unchanged: leading
/is stripped, and already-percent-encoded input likea%20b.pngis still decoded the same way. A test covers that case.Tests
relative_path_to_parts(async and sync)upload(async and sync) andget_public_urlassert the final request URLmainand pass with the fix; ruff and mypy are cleanCloses #1640
cc @olirice @silentworks for review
🤖 Generated with Claude Code