Skip to content

Commit

Permalink
Merge pull request #66 from gmdutra/master
Browse files Browse the repository at this point in the history
Adds the StatusOk constant
  • Loading branch information
brikis98 authored May 25, 2020
2 parents c209daa + fd180e0 commit 6d8646f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func downloadGithubZipFile(gitHubCommit GitHubCommit, gitHubToken string, instan
if err != nil {
return zipFilePath, wrapError(err)
}
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
return zipFilePath, newError(FAILED_TO_DOWNLOAD_FILE, fmt.Sprintf("Failed to download file at the url %s. Received HTTP Response %d.", req.URL.String(), resp.StatusCode))
}
if resp.Header.Get("Content-Type") != "application/zip" {
Expand Down
2 changes: 1 addition & 1 deletion github.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func callGitHubApi(repo GitHubRepo, path string, customHeaders map[string]string
return nil, wrapError(err)
}

if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
// Convert the resp.Body to a string
buf := new(bytes.Buffer)
_, goErr := buf.ReadFrom(resp.Body)
Expand Down

0 comments on commit 6d8646f

Please sign in to comment.