Skip to content

fix(proxy): fix off-by-one check in range_header_filter - #1094

Open
byte-kort wants to merge 1 commit into
cloudflare:mainfrom
byte-kort:fix-range-header-filter-boundary
Open

byte-kort wants to merge 1 commit into
cloudflare:mainfrom
byte-kort:fix-range-header-filter-boundary

Conversation

@byte-kort

@byte-kort byte-kort commented Oct 30, 2026 •

Copy link
Copy Markdown

Fixes #1063

Summary

Fixes an off-by-one bug where range_header_filter treated requests matching the exact max_multipart_ranges limit as exceeding it (RangeType::None), breaking single-range requests when max = Some(1).

Changes

  • Changed range_count >= max_ranges to range_count > max_ranges in pingora-proxy/src/proxy_cache.rs as intended by the accompanying comment ("more than max configured ranges").
  • Added an integration test in pingora-proxy/tests/range_filter_test.rs to verify exact-fit and boundary conditions.

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 this pull request may close these issues.

range_header_filter ignores Range when the range count equals max_multipart_ranges

1 participant