mirror of
https://github.com/minio/minio.git
synced 2025-11-25 12:06:10 -05:00
merge nested hash readers (#9582)
The `ioutil.NopCloser(reader)` was hiding nested hash readers. We make it an `io.Closer` so it can be attached without wrapping and allows for nesting, by merging the requests.
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package hash
|
||||
|
||||
import "fmt"
|
||||
|
||||
// SHA256Mismatch - when content sha256 does not match with what was sent from client.
|
||||
type SHA256Mismatch struct {
|
||||
ExpectedSHA256 string
|
||||
@@ -23,7 +25,7 @@ type SHA256Mismatch struct {
|
||||
}
|
||||
|
||||
func (e SHA256Mismatch) Error() string {
|
||||
return "Bad sha256: Expected " + e.ExpectedSHA256 + " is not valid with what we calculated " + e.CalculatedSHA256
|
||||
return "Bad sha256: Expected " + e.ExpectedSHA256 + " does not match calculated " + e.CalculatedSHA256
|
||||
}
|
||||
|
||||
// BadDigest - Content-MD5 you specified did not match what we received.
|
||||
@@ -33,5 +35,14 @@ type BadDigest struct {
|
||||
}
|
||||
|
||||
func (e BadDigest) Error() string {
|
||||
return "Bad digest: Expected " + e.ExpectedMD5 + " is not valid with what we calculated " + e.CalculatedMD5
|
||||
return "Bad digest: Expected " + e.ExpectedMD5 + " does not match calculated " + e.CalculatedMD5
|
||||
}
|
||||
|
||||
type ErrSizeMismatch struct {
|
||||
Want int64
|
||||
Got int64
|
||||
}
|
||||
|
||||
func (e ErrSizeMismatch) Error() string {
|
||||
return fmt.Sprintf("Size mismatch: got %d, want %d", e.Got, e.Want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user