mirror of
https://github.com/packwiz/packwiz.git
synced 2025-12-16 23:58:26 +01:00
Handle uppercase hashes properly (case-fold compare or normalise to lowercase)
This commit is contained in:
@@ -400,7 +400,7 @@ func (in Index) SaveFile(f IndexFile, dest io.Writer) error {
|
||||
}
|
||||
|
||||
calculatedHash := h.HashToString(h.Sum(nil))
|
||||
if calculatedHash != f.Hash && !viper.GetBool("no-internal-hashes") {
|
||||
if !strings.EqualFold(calculatedHash, f.Hash) && !viper.GetBool("no-internal-hashes") {
|
||||
return errors.New("hash of saved file is invalid")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user