opencontainers / opencontainers/distribution-spec
`Cotent-Range` and `Range` syntax expected by this spec deviates from RFC 7233 (HTTP/1.1 Range Requests)
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:
- https://developer.mozilla.org/de/docs/Web/HTTP/Reference/Headers/Content-Range
- https://developer.mozilla.org/de/docs/Web/HTTP/Reference/Headers/Range
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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