Skip to content

OCI distribution-spec conformance: Content-Length, digest validation, upload error codes #134

Description

@m-ferrero

Running this registry against the OCI distribution-spec conformance suite (sha256 path) surfaced a few small, independent gaps. I'd like to contribute a focused fix for each as its own self-contained PR, tracked here for the big picture. Each is minimal, ships with tests, and passes pnpm test on its branch.

And one related cleanliness item (not a conformance gap, but on the same content-negotiation strings):

  • Single-source the manifest media-type constants. manifestTypes in src/registry/http.ts re-types literals that named constants elsewhere already hold (and one type — the OCI image manifest — has no constant at all), so the same content-negotiation string lives in two places and an edit could silently diverge one copy from the spec. A pure, behavior-preserving refactor that builds the list from named constants. → refactor: build manifestTypes from named media-type constants (de-duplicate literals) #140

Scope note: SHA-512 is intentionally out of scope (an optional algorithm in the spec); these target the sha256 path. Happy to split, squash, or reorder any of these to whatever is easiest to review.

In case it's handy: each PR applies to main on its own, and they barely interact — the only shared spots are test/index.test.ts (each adds its own tests) and the blob-HEAD handler in src/router.ts (touched by the Content-Length and mounted-blob changes).

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