Match standard HTTP semantics of inclusive end value in Range and Content-Range headers#7643
Merged
achamayou merged 5 commits intomicrosoft:mainfrom Feb 5, 2026
Merged
Conversation
…e and Content-Range headers (microsoft#7632)" (microsoft#7641) This reverts commit 21d5180.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes the HTTP Range and Content-Range header handling to match standard HTTP semantics where the range end value is inclusive (e.g., "bytes=0-9" means 10 bytes, from 0 to 9 inclusive). This is a second attempt at resolving issue #7626, after the first attempt in #7632 was reverted in #7641 due to LTS compatibility issues.
Changes:
- Converted Range header parsing and Content-Range header emission to use HTTP-standard inclusive end values
- Maintained exclusive range end values internally for idiomatic C++ processing with conversions at I/O boundaries
- Added comprehensive test coverage for various range scenarios including edge cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| include/ccf/http_consts.h | Adds RANGE constant for consistent header name usage |
| src/node/rpc/file_serving_handlers.h | Updates server-side range request handling to parse inclusive end values from headers, process with exclusive values internally, and emit inclusive values in responses |
| src/snapshots/fetch.h | Updates client-side range request handling to send inclusive end values in requests and parse inclusive values from Content-Range responses |
| tests/e2e_operations.py | Adds comprehensive tests for inclusive range semantics including single-byte ranges, full ranges, partial ranges, open-ended ranges, and negative offsets |
achamayou
approved these changes
Feb 5, 2026
… sender used an exclusive or inclusive range end
eddyashton
commented
Feb 5, 2026
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.
This is take 2 at #7626. Previously implemented in #7632, but reverted in #7641 due to introducing an LTS compat failure. This should only be merged once we're sure LTS compat is green (multiple long_test runs).