Skip to content

Commit

Permalink
Jenkins.Init() should check Response.StatusCode #210
Browse files Browse the repository at this point in the history
  • Loading branch information
Bpazy committed Jul 8, 2020
1 parent 65ee8c9 commit 3655c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jenkins.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (j *Jenkins) Init() (*Jenkins, error) {
}

j.Version = rsp.Header.Get("X-Jenkins")
if j.Raw == nil {
if j.Raw == nil || rsp.StatusCode != http.StatusOK {
return nil, errors.New("Connection Failed, Please verify that the host and credentials are correct.")
}

Expand Down

0 comments on commit 3655c42

Please sign in to comment.