httpreader: also resume on UnexpectedEOF

This commit is contained in:
Łukasz Magiera 2023-04-15 14:02:50 +02:00
parent 71f184f5cb
commit a7d29c9564

View File

@ -98,7 +98,7 @@ func (r *ResumableReader) Read(p []byte) (n int, err error) {
n, err = r.reader.Read(p)
r.position += int64(n)
if err == io.EOF {
if err == io.EOF || err == io.ErrUnexpectedEOF {
if r.position == r.contentLength {
r.reader.Close()
return n, err