webseed/client.go | 11 +++++++++-- diff --git a/webseed/client.go b/webseed/client.go index 19153dc773c7331584aca3f0e1e16143b6e2cd45..420901ea761e678d4e8bdbc6a40c415d76d5c219 100644 --- a/webseed/client.go +++ b/webseed/client.go @@ -3,6 +3,7 @@ import ( "bytes" "context" + "errors" "fmt" "io" "net/http" @@ -91,8 +92,14 @@ if result.err != nil { return result.err } defer result.resp.Body.Close() - if part.e.Start != 0 && result.resp.StatusCode != http.StatusPartialContent { - return fmt.Errorf("expected partial content response got %v", result.resp.StatusCode) + switch result.resp.StatusCode { + case http.StatusPartialContent: + case http.StatusOK: + if part.e.Start != 0 { + return errors.New("got status ok but request was at offset") + } + default: + return fmt.Errorf("unhandled response status code (%v)", result.resp.StatusCode) } copied, err := io.Copy(buf, result.resp.Body) if err != nil {