Skip to content

Commit b39080e

Browse files
authored
Merge pull request #214 from Bpazy/master
Jenkins.Init() should check Response.StatusCode #210
2 parents ab81397 + 3655c42 commit b39080e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jenkins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (j *Jenkins) Init(ctx context.Context) (*Jenkins, error) {
6161
}
6262

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

0 commit comments

Comments
 (0)