Skip to content

Commit

Permalink
support OCI-Subject header
Browse files Browse the repository at this point in the history
fixes #18865
the response header OCI-Subject to indicate to the client that the registry processed the request's subject.

Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
System Administrator authored and wy65701436 committed Jul 4, 2023
1 parent 8fe5618 commit 1e9826e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server/middleware/subject/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func Middleware() func(http.Handler) http.Handler {
return err
}
}
w.Header().Set("OCI-Subject", subjectArt.Digest)
}

return nil
Expand Down
1 change: 1 addition & 0 deletions src/server/middleware/subject/subject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func (suite *MiddlewareTestSuite) TestSubject() {
suite.Equal(name, accs[0].GetData().SubArtifactRepo)
suite.True(accs[0].IsHard())
suite.Equal(accessorymodel.TypeSubject, accs[0].GetData().Type)
suite.Equal(subArtDigest, res.Header().Values("OCI-Subject")[0])
})
}

Expand Down

0 comments on commit 1e9826e

Please sign in to comment.