Skip to content

Apply the Range header to GET requests only (#1734) - #1735

Merged
thboileau-git merged 1 commit into
3.0from
fix/1734-range-get-only
Nov 28, 2026
Merged

thboileau-git merged 1 commit into
3.0from
fix/1734-range-get-only

Conversation

@thboileau-git

@thboileau-git thboileau-git commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1734.

RFC 9110 §14.2: a server MUST ignore a Range header received with a method for which range handling is not defined, and GET is the only one. RangeFilter.afterHandle only skipped the methods that are not safe, so HEAD, OPTIONS and TRACE (safe in Restlet) were answered 206 Partial Content. A HEAD with Range: bytes=0-3 returned Content-Length: 4 and a Content-Range instead of the metadata of the full entity.

The range is now applied to GET only. No API change.

Tests: RangeFilterTestCase (HEAD, OPTIONS, TRACE ignored, GET still 206) and RangeRequestEndToEndTestCase (real server: HEAD 200 with the full Content-Length, OPTIONS not 206, GET 206). changes.md updated.

Same fix on the other maintained versions: 2.7: #1736, 2.6: #1737

🤖 Generated with Claude Code

RFC 9110 section 14.2: GET is the only method for which range handling is
defined, the Range of any other method must be ignored. A HEAD or OPTIONS
request with a range was answered 206.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@thboileau-git
thboileau-git merged commit dc73b6b into 3.0 Nov 28, 2026
3 checks passed
@thboileau-git
thboileau-git deleted the fix/1734-range-get-only branch November 28, 2026 10:13
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.

1 participant