bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
863 stars 443 forks source link

Fixing the GetBuild() url path for customized domain #232

Closed ghost closed 3 years ago

ghost commented 3 years ago

GetBuild() fails when the jenkins domain name is not https://localhost: If jenkins is being accessed like this https://domain/jenkins , here /jenkins is part of the server path

In the above case the job url would like this https://domain/jenkins/job/JOB1

and url.Path would return /jenkins/job/JOB1 instead of job/JOB1 because of the GetPoll() fails since its polling https://domain/jenkins/jenkins/job/JOB1/api/json instead of https://domain/jenkins/job/JOB1/api/json

ghost commented 3 years ago

@bndr can u help merge this