mirror of
https://github.com/minio/minio.git
synced 2025-02-09 12:48:08 -05:00
Check for valid checksum (#20878)
Add a few safety measures for checksums.
This commit is contained in:
parent
4ee62606e4
commit
abb385af41
@ -271,10 +271,12 @@ func validateLengthAndChecksum(r *http.Request) bool {
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if !cs.Type.IsSet() {
|
||||
if cs == nil || !cs.Type.IsSet() {
|
||||
return false
|
||||
}
|
||||
r.Body = hash.NewChecker(r.Body, cs.Type.Hasher(), cs.Raw, r.ContentLength)
|
||||
if cs.Valid() && !cs.Type.Trailing() {
|
||||
r.Body = hash.NewChecker(r.Body, cs.Type.Hasher(), cs.Raw, r.ContentLength)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user