mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
support OCI-Subject header (#18885)
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> Co-authored-by: System Administrator <root@wangyanCQFQY.vmware.com>
This commit is contained in:
parent
1d2624eefc
commit
dbaae9e64e
@ -129,6 +129,7 @@ func Middleware() func(http.Handler) http.Handler {
|
||||
return err
|
||||
}
|
||||
}
|
||||
w.Header().Set("OCI-Subject", subjectArt.Digest)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -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])
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user