Skip to content

Commit

Permalink
Merge pull request #214 from Bpazy/master
Browse files Browse the repository at this point in the history
Jenkins.Init() should check Response.StatusCode #210
  • Loading branch information
figo authored Feb 26, 2021
2 parents ab81397 + 3655c42 commit b39080e
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 @@ -61,7 +61,7 @@ func (j *Jenkins) Init(ctx context.Context) (*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 b39080e

Please sign in to comment.