Skip to content

fix: fall back to resumable upload method allowlist when getMediaUpload is unset - #902

Open
viacheslav-rostovtsev wants to merge 1 commit into
googleapis:mainfrom
viacheslav-rostovtsev:dev/virost/fix/media_upload_allowlist_fallback
Open

viacheslav-rostovtsev wants to merge 1 commit into
googleapis:mainfrom
viacheslav-rostovtsev:dev/virost/fix/media_upload_allowlist_fallback

Conversation

@viacheslav-rostovtsev

Copy link
Copy Markdown
Member

Summary

Un-nests the RPC/package allowlist fallback in MethodDetails::maybeCreateResumableUpload out of the else block so it executes whenever $isMediaUpload evaluates to false, regardless of whether HttpRule::getMediaUpload() exists on the loaded google/common-protos class.

Without this change, once google/common-protos publishes HttpRule::getMediaUpload(), allowlisted RPCs whose service protos do not yet set the media_upload annotation return null from $httpRule->getMediaUpload(), evaluate $isMediaUpload to false, and bypass the allowlist fallback (regressing to normal unary RPC generation).

…ad is unset

Un-nest the hardcoded RPC/package allowlist in
MethodDetails::maybeCreateResumableUpload from the else block so it runs
whenever $isMediaUpload evaluates to false. Otherwise, once
google/common-protos exposes HttpRule::getMediaUpload(), allowlisted RPCs
whose protos do not yet set the media_upload option return null from
getMediaUpload() and skip the allowlist fallback.
@viacheslav-rostovtsev
viacheslav-rostovtsev requested a review from a team as a code owner November 10, 2026 22:06

@bshaffer bshaffer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tests?

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.

2 participants