Skip to content

Commit

Permalink
checksumHashAndValue return a type even if there is no semicolor for …
Browse files Browse the repository at this point in the history
…better error
  • Loading branch information
azr committed Jan 8, 2019
1 parent e47d598 commit dd14d29
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ func checksumHashAndValue(u *url.URL) (checksumHash hash.Hash, checksumValue []b

// Determine the checksum hash type
checksumType := ""
idx := strings.Index(v, ":")
if idx > -1 {
checksumType = v[:idx]
idx := len(v)
if i := strings.Index(v, ":"); i > -1 {
idx = i
}
checksumType = v[:idx]
if fn, found := checksummers[checksumType]; found {
checksumHash = fn()
// Get the remainder of the value and parse it into bytes
Expand Down

0 comments on commit dd14d29

Please sign in to comment.