Skip to content

Commit

Permalink
If a valid release asset cannot be found, return a descriptive error. (
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashkumar authored Jul 15, 2021
1 parent 78e03b8 commit 4783fef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handlers/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func Download(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
}
}

if currentAsset == nil {
sendErrorWithCode(w, "Unable to find a release asset for your platform in the latest release.", 400)
}

log.Printf("User-Agent: %s", r.Header.Get("User-Agent"))
log.Printf("Selected Asset: %s", currentAsset.DownloadURL)
if !opts.Uncompress {
Expand Down

0 comments on commit 4783fef

Please sign in to comment.