loosen http status code checks

This commit is contained in:
Michael Yang
2023-08-26 21:55:21 -07:00
parent 865fceb73c
commit 246dc65417
5 changed files with 16 additions and 17 deletions

View File

@@ -168,7 +168,7 @@ func doDownload(ctx context.Context, opts downloadOpts, f *FileDownload) error {
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent {
if resp.StatusCode >= http.StatusBadRequest {
body, _ := io.ReadAll(resp.Body)
return fmt.Errorf("%w: on download registry responded with code %d: %v", errDownload, resp.StatusCode, string(body))
}