Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
uploader: Update errors check
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Aug 10, 2023
1 parent 144d5d5 commit 15f0295
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uploader/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package uploader
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -243,7 +244,7 @@ func (u *Uploader) Upload(c *fasthttp.RequestCtx) {
// pipelined header. Thus we need to drain the body buffer.
for {
_, err = bodyStream.Read(drainBuf)
if err == io.EOF || err == io.ErrUnexpectedEOF {
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) {
break
}
}
Expand Down

0 comments on commit 15f0295

Please sign in to comment.