Skip to content

escape bucket in downloadURLFromMetadataDictionary - #16529

Merged
paulb777 merged 1 commit into
firebase:mainfrom
isl-Ramzi:storage-download-url-bucket-escape
Aug 18, 2026
Merged

paulb777 merged 1 commit into
firebase:mainfrom
isl-Ramzi:storage-download-url-bucket-escape

Conversation

@isl-Ramzi

Copy link
Copy Markdown
Contributor

downloadURLFromMetadataDictionary interpolates the bucket from the fetch response straight into the URL path while the object name goes through GCSEscapedString, so a bucket value carrying a path delimiter like "#" or "?" makes percentEncodedPath raise, one carrying a "/" rewrites the /o/ segment of the returned download URL, and a non-string JSON value is stringified as its Swift description. StorageUtils.encodedURL(for:) escapes the bucket the same way, so this is the one path that skips it. Read the bucket as a String and run it through GCSEscapedString, matching the object handling one line down.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@paulb777

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ensures that the bucket name is properly cast to a string and percent-escaped when constructing the download URL, and adds a unit test to verify this behavior. The reviewer suggested using a guard let statement to safely unwrap both bucket and path instead of using fallback error strings, which would allow the method to fail gracefully by returning nil if they are missing.

@paulb777 paulb777 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@paulb777
paulb777 merged commit 0a7ab23 into firebase:main Aug 18, 2026
56 checks passed
@paulb777 paulb777 added this to the 12.19.0 - M186 milestone Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants