fix: if we get an ErrUnexpectedEOF due to being less than512 bytes, read it all instead
This commit is contained in:
parent
8a112a8c12
commit
a9c2ecade0
|
@ -174,7 +174,16 @@ func (s StorageServiceDefault) UploadObject(ctx context.Context, protocol Storag
|
||||||
}
|
}
|
||||||
_, err = io.ReadFull(reader, mimeBytes)
|
_, err = io.ReadFull(reader, mimeBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
if !errors.Is(err, io.ErrUnexpectedEOF) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
reader, err = getReader()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
mimeBytes, err = io.ReadAll(reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
reader, err = getReader()
|
reader, err = getReader()
|
||||||
|
|
Loading…
Reference in New Issue