mirror of
https://github.com/distribution/distribution.git
synced 2025-09-01 15:07:25 +00:00
Merge pull request #233 from xiekeyang/master
digest: func Validate in digest doesn't filter no-hex data
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user