Skip to content

Commit

Permalink
Check response status in GetRemoteFileDetails (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored May 23, 2023
1 parent fe06c78 commit 54b6a35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions http/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,10 @@ func (jc *HttpClient) GetRemoteFileDetails(downloadUrl string, httpClientsDetail
return nil, nil, err
}

if resp.StatusCode != http.StatusOK {
return nil, resp, nil
if err = errorutils.CheckResponseStatus(resp, http.StatusOK); err != nil {
return nil, nil, err
}
log.Debug("Artifactory response:", resp.Status)

fileSize := int64(0)
contentLength := resp.Header.Get("Content-Length")
Expand Down

0 comments on commit 54b6a35

Please sign in to comment.