Skip to content

fix(storage): make empty-bucket resource URI path formatting consistent with path-style formatting - #15277

Open
nidhiii-27 wants to merge 1 commit into
mainfrom
fix/storage-resource-uri-path-formatting
Open

nidhiii-27 wants to merge 1 commit into
mainfrom
fix/storage-resource-uri-path-formatting

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

StorageImpl.constructResourceUriPath now always prepends a path delimiter to non-empty object names when the bucket segment is empty, matching the path-style formatting branch. StorageImpl.signUrl and SignatureInfo also pass the formatted resource path string directly during URL assembly and signing while keeping the existing public URI-based SignatureInfo API and path-style signed URL behavior unchanged. Added unit test coverage in StorageImplMockitoTest and SignatureInfoTest.

…nt with path-style formatting

StorageImpl.constructResourceUriPath now always prepends a path delimiter to non-empty object names when the bucket segment is empty, matching the path-style formatting branch. StorageImpl.signUrl and SignatureInfo also pass the formatted resource path string directly during URL assembly and signing while keeping the existing public URI-based SignatureInfo API and path-style signed URL behavior unchanged. Added unit test coverage in StorageImplMockitoTest and SignatureInfoTest.

[Generated-by: AI]
@nidhiii-27 nidhiii-27 added ai-generated Pull Request generated by AI storage-bug-immunity labels Nov 29, 2026

@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 updates the signed URL generation logic to preserve leading slashes in object names by passing the canonicalized resource as a String instead of parsing it into a URI, which would otherwise strip duplicate slashes. Corresponding unit tests have been added to verify this behavior. A review comment highlights that passing null for the URI in the new builder method is a breaking change for the public API getCanonicalizedResource() and suggests attempting to parse the string into a URI with a fallback to null to maintain backward compatibility.

@nidhiii-27 nidhiii-27 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 29, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 29, 2026
@nidhiii-27
nidhiii-27 marked this pull request as ready for review November 29, 2026 19:51
@nidhiii-27
nidhiii-27 requested review from a team as code owners November 29, 2026 19:51
@nidhiii-27
nidhiii-27 requested a review from Dhriti07 November 29, 2026 19:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull Request generated by AI storage-bug-immunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants