-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: MediaIoBaseDownload range header off-by-one #1595
Merged
gcf-merge-on-green
merged 2 commits into
googleapis:main
from
jvtm:fix-mediaiobasedownload-range-header
Nov 11, 2021
Merged
fix: MediaIoBaseDownload range header off-by-one #1595
gcf-merge-on-green
merged 2 commits into
googleapis:main
from
jvtm:fix-mediaiobasedownload-range-header
Nov 11, 2021
Conversation
This file contains 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
Issue: It looks like Range header end value was constructed by adding chunk size to current position. This leads into the request being one byte longer, and also the received response body is one byte longer than anticipated. Fix: adjust the end to be one byte earlier. For example with `chunksize=1024` and current position being 0, the range header should be set to `bytes=0-1023`. See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier Resolves: googleapis#1593
4262b62
to
d9777dc
Compare
parthea
approved these changes
Nov 11, 2021
Thanks for the fix @jvtm ! |
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Nov 16, 2021
🤖 I have created a release \*beep\* \*boop\* --- ## [2.31.0](https://github.com/googleapis/google-api-python-client/compare/v2.30.0...v2.31.0) (2021-11-16) ### Features * **bigtableadmin:** update the api be7ffcc ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **chromemanagement:** update the api 59c9799 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **cloudasset:** update the api 60f5758 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **cloudfunctions:** update the api c517033 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **contactcenterinsights:** update the api 9ac9faa ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **containeranalysis:** update the api 618985b ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **datapipelines:** update the api a39bb0f ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **datastore:** update the api 5050adb ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **dialogflow:** update the api fd46c12 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **documentai:** update the api 3ba3182 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **drive:** update the api b1840b0 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **file:** update the api b13a249 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **gkehub:** update the api 37cce48 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **healthcare:** update the api 8d1f955 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **metastore:** update the api 9c90df7 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **monitoring:** update the api bf890b6 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **mybusinessbusinessinformation:** update the api 90e206c ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **paymentsresellersubscription:** update the api c879654 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **recaptchaenterprise:** update the api ff95700 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **recommender:** update the api d85fe38 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **securitycenter:** update the api 35a6d4e ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **speech:** update the api 13f1bcb ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **sqladmin:** update the api 770bc14 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **tpu:** update the api ea30e3a ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) * **vmmigration:** update the api 80e2090 ([815c1ac](https://github.com/googleapis/google-api-python-client/commit/815c1ac7e3f7c7ea6df920645adb8cba84b05c22)) ### Bug Fixes * MediaIoBaseDownload range header off-by-one ([#1595](https://github.com/googleapis/google-api-python-client/issues/1595)) ([4b73b2e](https://github.com/googleapis/google-api-python-client/commit/4b73b2e9d53e63404c8800f2a2b3f1ee86680815)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Issue: It looks like Range header end value was constructed by adding chunk size to
current position. This leads into the request being one byte longer, and also
the received response body is one byte longer than anticipated.
Fix: adjust the end to be one byte earlier.
For example with
chunksize=1024
and current position being 0, the range headershould be set to
bytes=0-1023
.See: https://httpwg.org/specs/rfc7233.html#rule.ranges-specifier
Fixes #1593
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1593 🦕