chore: modify range to allow queries specifying only the start index#184
Merged
Conversation
kessplas
requested changes
Feb 9, 2024
| adjustedRange[0] = Integer.parseInt(rangeSplit[1]); | ||
| adjustedRange[1] = Integer.parseInt(rangeSplit[2]); | ||
| adjustedRange[0] = Integer.parseInt(rangeSplit[0]); | ||
| adjustedRange[1] = (rangeSplit.length < 2 || rangeSplit[1].isEmpty()) ? Integer.MAX_VALUE : Integer.parseInt(rangeSplit[1]); |
Contributor
There was a problem hiding this comment.
Using Integer.MAX_VALUE is not correct, the type signature is long so we should use longs here and elsewhere.
| return null; | ||
| } | ||
| if (!range.matches("bytes=[0-9]+-[0-9]+")) { | ||
| if (!range.matches("^bytes=(\\d+-\\d+|\\d+-)$")) { |
Contributor
There was a problem hiding this comment.
nit: since this is a public method, we should add some unit tests around the range input and how it is handled
Contributor
Author
There was a problem hiding this comment.
agreed, will add some unit test cases around desired range and crypto range
josecorella
pushed a commit
that referenced
this pull request
Mar 21, 2024
## [3.1.2](v3.1.1...v3.1.2) (2024-03-21) ### Fixes * create clients only if necessary ([#187](#187)) ([ea0c0c7](ea0c0c7)) * do not signal onComplete when the incoming buffer length is less than the cipher block ([#209](#209)) ([8b1a686](8b1a686)) ### Maintenance * fix dependabot.yml ([#190](#190)) ([5ee8b08](5ee8b08)) * modify range to allow queries specifying only the start index ([#184](#184)) ([765b9c6](765b9c6)) * **README:** detail no unencrypted pass through ([#189](#189)) ([576ea66](576ea66)), closes [#186](#186) [/github.com//issues/186#issuecomment-1973016669](https://github.com/aws//github.com/aws/amazon-s3-encryption-client-java/issues/186/issues/issuecomment-1973016669)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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 #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: