Skip to content

Commit

Permalink
Merge pull request #297 from luotianqi777/fix_mvn
Browse files Browse the repository at this point in the history
fix: mvn download
  • Loading branch information
cyberchen1995 authored Jun 28, 2024
2 parents 947500f + 5f4bc3d commit 79bd286
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions opensca/common/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ func DownloadUrlFromRepos(route string, do func(repo RepoConfig, r io.Reader), r
resp, err := HttpDownloadClient.Do(req)
if err != nil {
logs.Warn(err)
return false
continue
}
defer resp.Body.Close()
defer io.Copy(io.Discard, resp.Body)

if resp.StatusCode != 200 {
logs.Warnf("%d %s", resp.StatusCode, url)
io.Copy(io.Discard, resp.Body)
resp.Body.Close()
} else {
logs.Debugf("%d %s", resp.StatusCode, url)
do(repo, resp.Body)
resp.Body.Close()
return true
}

Expand Down

0 comments on commit 79bd286

Please sign in to comment.