opencontainers / opencontainers/distribution-spec

`Cotent-Range` and `Range` syntax expected by this spec deviates from RFC 7233 (HTTP/1.1 Range Requests)

Open
#586 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
260
Avg merge
3d 23h
Merged PRs (30d)
1

Description

In the OCI spec, the Content-Range header is specified as:

Content-Range: <range>

where <range> must match the pattern ^[0-9]+-[0-9]+$ (e.g., "0-1023").

However, RFC 7233 (https://datatracker.ietf.org/doc/html/rfc7233) defines the Content-Range header syntax as:

Content-Range: <unit> <range-resp>/<size>

For byte ranges, this could be:

Content-Range: bytes 0-1023/2048

or

Content-Range: bytes 0-1023/*

This OCI spec omits both:

  • The unit specifier ("bytes") and
  • The total size or "*" after the slash

This inconsistency causes interoperability issues with HTTP libraries and proxies that strictly validate header formats according to RFC specifications. For example, Rust's https://crates.io/crates/headers crate.

The same applies to the Range header. Although the Range header uses slightly different syntax. Also see the syntax block in:

This spec should either:

  • Make explicit that it uses the standard HTTP headers with non-conforming syntax requirement, where custom validation and parsing must be implemented or
  • Use a new oci-dsitribution spec specific header name to which the current requirements can be applied or
  • Update the spec to require HTTP RFC compliant values (and update the conformance tests with it)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the OCI spec's Content-Range and Range syntax with RFC 7233 and the cited MDN references. Review the conformance tests mentioned in the issue and determine which header behavior they enforce. Done means the specification clearly defines the chosen header syntax and the conformance tests reflect it.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.