Skip to content

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

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

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

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: 3.0: #1735, 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 8c88f00 into 2.7 Nov 28, 2026
6 checks passed
@thboileau-git
thboileau-git deleted the fix/1734-range-get-only-2.7 branch November 28, 2026 10:08
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.

A Range header is applied to HEAD and OPTIONS requests, answered with 206

1 participant