{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/999","repository_url":"https://api.github.com/repos/aws/aws-sdk-net","labels_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/999/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/999/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/999/events","html_url":"https://github.com/aws/aws-sdk-net/pull/999","id":339469657,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMTE0OTg2","number":999,"title":"Provide support for byte-ranges without requiring both values in S3's GetObject","user":{"login":"binsenpai","id":25821642,"node_id":"MDQ6VXNlcjI1ODIxNjQy","avatar_url":"https://avatars1.githubusercontent.com/u/25821642?v=4","gravatar_id":"","url":"https://api.github.com/users/binsenpai","html_url":"https://github.com/binsenpai","followers_url":"https://api.github.com/users/binsenpai/followers","following_url":"https://api.github.com/users/binsenpai/following{/other_user}","gists_url":"https://api.github.com/users/binsenpai/gists{/gist_id}","starred_url":"https://api.github.com/users/binsenpai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binsenpai/subscriptions","organizations_url":"https://api.github.com/users/binsenpai/orgs","repos_url":"https://api.github.com/users/binsenpai/repos","events_url":"https://api.github.com/users/binsenpai/events{/privacy}","received_events_url":"https://api.github.com/users/binsenpai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-09T14:19:32Z","updated_at":"2018-07-11T19:48:39Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/aws/aws-sdk-net/pulls/999","html_url":"https://github.com/aws/aws-sdk-net/pull/999","diff_url":"https://github.com/aws/aws-sdk-net/pull/999.diff","patch_url":"https://github.com/aws/aws-sdk-net/pull/999.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n## Description\r\n<!--- Describe your changes in detail -->\r\nWhen byte-ranges are used in web requests, sometimes we get formats such as `0-`, `-500`, or even `500-900`. The AWS S3 SDK for .NET has only supported having both the start of the range and the end of the range when requesting byte ranges. According to [RFC 7233 (Range Requests)](https://tools.ietf.org/html/rfc7233), the start value or end value of the range is not required and can be assumed by the server.\r\n\r\nI've changed the `ByteRange.cs` to support `long`s that are `null` due to the fact that both can be null. When the getter for `FormattedByteRange` is called, it checks if both values are null, and if so, it returns a null `string`. I've also modified `GetObjectRequest`'s `IsSetByteRange` to support checking whether both values are null as well. This prevents an empty header from being added to the request.\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\nI implemented this change because on one of my projects, I serve a file using the `ResponseStream` I get from the AWS SDK for .NET from my ASP.NET Core app. I also checked the request's headers for byte-ranges and would forward those to the AWS SDK for .NET, but the SDK doesn't support an empty starting or ending range, so I was stuck when Google Chrome tried to request ranges `0-`.\r\n\r\n<!--- If it fixes an open [issue][issues], please link to the issue here -->\r\nThis change should provide a solution for, and fix the issue #886 \r\n\r\n## Testing\r\n<!--- Please describe in detail how you tested your changes -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\nI haven't done any proper testing yet, but my changes affect the way the SDK determines if a `byteRange` has been set or not, and allowed for nullable `long`s in `ByteRange.cs`, which means that existing code *might* break. I'm confused about whether to set this as a breaking change or not, but I will.\r\n\r\nI would appreciate if someone else added tests to this PR and test my code thoroughly, and if someone could place a PR for the documentation as well. Thanks.\r\n\r\n## Screenshots (if appropriate)\r\nNone are available and none are needed.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [x] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project\r\n- [x] My change requires a change to the documentation\r\n- [ ] I have updated the documentation accordingly\r\n- [x] I have read the **README** document\r\n- [ ] I have added tests to cover my changes\r\n- [ ] All new and existing tests passed\r\n\r\n## License\r\n<!--- The SDK is released under the [Apache 2.0 license][license], so any code you submit will be released under that license -->\r\n<!--- For substantial contributions, we may ask you to sign a [Contributor License Agreement (CLA)][cla] -->\r\n<!--- Put an `x` in the below box if you confirm that this request can be released under the Apache 2 license -->\r\n- [x] I confirm that this pull request can be released under the Apache 2 license\r\n\r\n[issues]: https://github.com/aws/aws-sdk-net/issues\r\n[license]: http://aws.amazon.com/apache2.0/\r\n[cla]: http://en.wikipedia.org/wiki/Contributor_License_Agreement"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/comments/404288928","html_url":"https://github.com/aws/aws-sdk-net/pull/999#issuecomment-404288928","issue_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/999","id":404288928,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDI4ODkyOA==","user":{"login":"binsenpai","id":25821642,"node_id":"MDQ6VXNlcjI1ODIxNjQy","avatar_url":"https://avatars1.githubusercontent.com/u/25821642?v=4","gravatar_id":"","url":"https://api.github.com/users/binsenpai","html_url":"https://github.com/binsenpai","followers_url":"https://api.github.com/users/binsenpai/followers","following_url":"https://api.github.com/users/binsenpai/following{/other_user}","gists_url":"https://api.github.com/users/binsenpai/gists{/gist_id}","starred_url":"https://api.github.com/users/binsenpai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binsenpai/subscriptions","organizations_url":"https://api.github.com/users/binsenpai/orgs","repos_url":"https://api.github.com/users/binsenpai/repos","events_url":"https://api.github.com/users/binsenpai/events{/privacy}","received_events_url":"https://api.github.com/users/binsenpai/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T19:48:39Z","updated_at":"2018-07-11T19:48:39Z","author_association":"NONE","body":"@gokarnm Alright, I added the changes here. Feel free to have a look. Would it be all-right if I added a check to see if the \"bytes=\" value was present in the constructor and setter, and append it, if not?"}}
{"actor":{"display_login":"binsenpai"}}