Skip to content

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

@lpotthast

Description

@lpotthast

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions