Skip to content

fix: accept unknown-size Content-Range values#5120

Merged
trivikr merged 4 commits into
nodejs:mainfrom
trivikr:content-range-bytes-unknown-length
May 6, 2026
Merged

fix: accept unknown-size Content-Range values#5120
trivikr merged 4 commits into
nodejs:mainfrom
trivikr:content-range-bytes-unknown-length

Conversation

@trivikr

@trivikr trivikr commented Apr 26, 2026

Copy link
Copy Markdown
Member

This relates to...

Fixes: #5119

Rationale

Content-Range values such as bytes 3-5/* are valid when the complete representation length is unknown.
The retry resume path previously rejected these headers as a Content-Range mismatch, which could fail otherwise valid resumable 206 Partial Content responses.

Changes

  • Accept * as the complete length in Content-Range byte ranges.
  • Parse unknown complete length as size: null.

Features

N/A

Bug Fixes

Accept unknown-size Content-Range values

Breaking Changes and Deprecations

N/A

Status

Assisted-by: openai:gpt-5.5

Assisted-by: openai:gpt-5.5
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter

codecov-commenter commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (2b0d4c9) to head (f4694f9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5120   +/-   ##
=======================================
  Coverage   93.27%   93.27%           
=======================================
  Files         110      110           
  Lines       36366    36366           
=======================================
  Hits        33922    33922           
  Misses       2444     2444           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread test/retry-handler.js Outdated
@trivikr trivikr requested a review from mcollina April 26, 2026 16:09

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@trivikr trivikr merged commit 01122da into nodejs:main May 6, 2026
35 checks passed
@trivikr trivikr deleted the content-range-bytes-unknown-length branch May 6, 2026 22:41
@github-actions github-actions Bot mentioned this pull request May 14, 2026
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.

Content-Range parser rejects valid unknown-size byte ranges

4 participants