Skip to content

Match standard HTTP semantics of inclusive end value in Range and Content-Range headers#7643

Merged
achamayou merged 5 commits intomicrosoft:mainfrom
eddyashton:range_header_semantics_2
Feb 5, 2026
Merged

Match standard HTTP semantics of inclusive end value in Range and Content-Range headers#7643
achamayou merged 5 commits intomicrosoft:mainfrom
eddyashton:range_header_semantics_2

Conversation

@eddyashton
Copy link
Member

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).

@eddyashton eddyashton requested a review from a team as a code owner February 4, 2026 15:23
Copilot AI review requested due to automatic review settings February 4, 2026 15:23
@eddyashton eddyashton added the run-long-test Run Long Test job label Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 achamayou enabled auto-merge (squash) February 5, 2026 13:27
@achamayou achamayou merged commit e88bb08 into microsoft:main Feb 5, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-long-test Run Long Test job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants