jenkinsci / jenkinsci/java-client-api
I encountered a ClientProtocolException problem
- Langage dominant
- Java
- Étoiles
- 913
- Forks
- 466
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I encountered a ClientProtocolException problem when I called the build.Stop() method with Jenkins server version 2.32.2;
`public String Stop() throws HttpResponseException, IOException {`
` try { `
`return client.get(url + "stop");`
`} catch (IOException ex) {`
`if (((HttpResponseException) ex).getStatusCode() == 405) {`
`stopPost();`
`return ""; `
` } `
`}`
` return "";`
`}`
This version of the stop API should be Post on http://url/job/testJob/1/stop, but is actually call the Get http://url/job/testJob/1/stop/api/json, resulting in Jenkins CircularRedirectException from server
>
>
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start by inspecting the Stop() and stopPost() methods and how client.get constructs the request URL. Reproduce the call against Jenkins 2.32.2 and verify that stopping a build uses the POST endpoint rather than requesting /stop/api/json with GET. Done means the stop operation completes without the redirect or ClientProtocolException.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100