1
0
Fork 1
mirror of https://github.com/distribution/distribution synced 2024-09-16 07:33:43 +00:00

:func Validate in digest doesn't filter no-hex data

This commit is contained in:
xiekeyang 2015-03-04 16:02:50 +08:00
parent 91403c1b52
commit 8081a13cdf

View file

@ -112,6 +112,10 @@ func (d Digest) Validate() error {
// Continue on for general parser
if !DigestRegexp.MatchString(s) {
return ErrDigestInvalidFormat
}
i := strings.Index(s, ":")
if i < 0 {
return ErrDigestInvalidFormat
@ -129,8 +133,6 @@ func (d Digest) Validate() error {
return ErrDigestUnsupported
}
// TODO(stevvooe): Use DigestRegexp to validate digest here.
return nil
}