Skip to content

Commit

Permalink
add content digest and length headers for head
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Jan 24, 2025
1 parent 29653c0 commit 2fb641a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def show
authorize! descriptor

if request.head?
response.headers['Docker-Content-Digest'] = descriptor.content_digest # oras likes these
response.headers['Content-Length'] = descriptor.content_length

# see: https://github.com/opencontainers/distribution-spec/blob/main/spec.md#checking-if-content-exists-in-the-registry
head :ok
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def show
response.content_type = manifest.content_type

if request.head?
response.headers['Docker-Content-Digest'] = manifest.content_digest # oras likes these
response.headers['Content-Length'] = manifest.content_length

# see: https://github.com/opencontainers/distribution-spec/blob/main/spec.md#checking-if-content-exists-in-the-registry
head :ok
else
Expand Down

0 comments on commit 2fb641a

Please sign in to comment.