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

Support half open ranges #1438

Closed
arpad-m opened this issue Oct 12, 2023 · 2 comments · Fixed by #1482
Closed

Support half open ranges #1438

arpad-m opened this issue Oct 12, 2023 · 2 comments · Fixed by #1482

Comments

@arpad-m
Copy link
Contributor

arpad-m commented Oct 12, 2023

Both the standard Range HTTP header (or range in HTTP/2 lingo) as well as the x-ms-range header support half open ranges, meaning ones like bytes=1234-.

https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-blob-service-operations

The SDK's Range type does not however: it always requires an end to be specified.

As the end is exposed, it would be a semver breaking change to turn the end field on the Range into an option (or even a bool field has_end or such as the struct is exhaustively public).

@demoray
Copy link
Contributor

demoray commented Oct 12, 2023

If this is something we include, we might do something akin to the SliceIndex trait, where it supports multiple of the base range types (including RangeFrom).

@arpad-m
Copy link
Contributor Author

arpad-m commented Oct 12, 2023

The spec for the range header says that there is two possible ranges, one "int range" which has an obligatory start and an optional end, and one "suffix range", which has no start but an end. Then the range header is a comma seperated list of int or suffix ranges.

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 a pull request may close this issue.

2 participants