[#185] Fix payload reader
When we use io.CopyBuffer it check for exact io.EOF matching, so we need keep original EOF error otherwise io.CopyBuffer returns error Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
adec93af54
commit
631d9d83b6
1 changed files with 3 additions and 0 deletions
|
@ -263,6 +263,9 @@ type payloadReader struct {
|
||||||
|
|
||||||
func (x payloadReader) Read(p []byte) (int, error) {
|
func (x payloadReader) Read(p []byte) (int, error) {
|
||||||
n, err := x.ReadCloser.Read(p)
|
n, err := x.ReadCloser.Read(p)
|
||||||
|
if err != nil && errors.Is(err, io.EOF) {
|
||||||
|
return n, err
|
||||||
|
}
|
||||||
return n, handleObjectError("read payload", err)
|
return n, handleObjectError("read payload", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue