Skip to content

Commit 3655c42

Browse files
committed
Jenkins.Init() should check Response.StatusCode #210
1 parent 65ee8c9 commit 3655c42

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
@@ -59,7 +59,7 @@ func (j *Jenkins) Init() (*Jenkins, error) {
5959
}
6060

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

0 commit comments

Comments
 (0)