Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storage): add a safety check for readhandle #11549

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shubham-diwakar
Copy link
Contributor

By running some tests observed that default ReadObjectSpec looks like:
read_object_spec:{bucket:"projects/_/buckets/bucket-name" object:"obj-name" read_handle:{}}

Which is not correct as we pass nil read_handle. Added an check in NewRangeReader and NewMultiRangeDownloader to only pass read_handle in read_object_spec when it is not nil.

Reason: Default value of readHandle that we attach to objectHandle will be []( same as default value of byte array).

In case nil read_handle is passed by user we would already be doing the slow auth hence adding the check should not be a issue in that case too.

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 31, 2025
@shubham-diwakar shubham-diwakar marked this pull request as ready for review January 31, 2025 22:02
@shubham-diwakar shubham-diwakar requested review from a team as code owners January 31, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant