httpreader: also resume on UnexpectedEOF

This commit is contained in:
Łukasz Magiera
2023-04-25 09:31:20 +02:00
parent 71f184f5cb
commit a7d29c9564
+1 -1
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