Skip to content

Clarify 200 vs 206 status codes for Range header requests#114

Open
nsheff wants to merge 1 commit into
fix/sequence-paramsfrom
fix/status-code-clarification
Open

Clarify 200 vs 206 status codes for Range header requests#114
nsheff wants to merge 1 commit into
fix/sequence-paramsfrom
fix/status-code-clarification

Conversation

@nsheff
Copy link
Copy Markdown
Member

@nsheff nsheff commented May 28, 2026

Summary

  • Restructures Range header response options as a clear bullet list
  • Clarifies that 200 OK is for servers that don't support Range headers (not servers that "choose to ignore" valid requests)
  • Adds explicit status code rules in the Response section
  • Uses SHOULD/MAY language per RFC 7233 for Range requests spanning the entire sequence

Context

This PR addresses the inconsistencies identified in #106:

  1. The spec said servers could return "200 and contain the entire sequence (thus ignoring the Range header)" — but also said "the response must only contain the specified sub-sequence"
  2. The Response section's status code guidance was unclear

The key clarification: returning 200 OK with the full sequence is only valid for servers that don't support Range headers — not servers that support them but arbitrarily ignore requests.

Stacked on

This PR is stacked on #113 (fix/sequence-params). Merge #113 first.

Fixes #106

- Restructure Range header response options as clear bullet list
- Clarify that 200 OK is for servers that don't support Range headers (not servers that "choose to ignore" valid requests)
- Add explicit status code rules in Response section
- Use SHOULD/MAY language per RFC 7233 for Range requests spanning entire sequence

Fixes #106
Copy link
Copy Markdown
Collaborator

@andrewyatz andrewyatz left a comment

Choose a reason for hiding this comment

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

Changes look good and matches what I had expected was the default behaviour of implementations. Assume that some will send back 200 for a partial request.

Can I check what we expect to happen if we request a subsequence that happens to be the entire length of the requested sequence. Spec as it reads would says 200 since the subsequence is the entire sequence

Comment thread docs/sequences/README.md
Comment on lines +201 to +205
When a request is successful:
- If the server returns the entire sequence and no Range header was specified, the server MUST return `200 OK`
- If a Range header was specified and the server returns only the requested sub-sequence, the server MUST return `206 Partial Content`
- If a Range header was specified but the server does not support Range headers, it MUST return `200 OK` with the entire sequence
- If a Range header requests the entire sequence (e.g., `Range: bytes=0-`), the server SHOULD return `206 Partial Content` to indicate Range header support, but MAY return `200 OK`
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.

That's much clearer, but it now appears to be just explaining how Range headers work. Is it necessary to spell this out in such detail in this specification, or should it just point to the relevant RFC section?

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.

3 participants