Skip to content

Commit

Permalink
Simplify fetcher HTTP status code check
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <[email protected]>
  • Loading branch information
rdimitrov committed Feb 6, 2024
1 parent 0b437b3 commit 5a80a49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metadata/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (d *DefaultFetcher) DownloadFile(urlPath string, maxLength int64, timeout t
}
defer res.Body.Close()
// Handle HTTP status codes.
if res.StatusCode == http.StatusNotFound || res.StatusCode == http.StatusForbidden || res.StatusCode != http.StatusOK {
if res.StatusCode != http.StatusOK {
return nil, &metadata.ErrDownloadHTTP{StatusCode: res.StatusCode, URL: urlPath}
}
var length int64
Expand Down

0 comments on commit 5a80a49

Please sign in to comment.