jenkinsci / jenkinsci/java-client-api
status code: 414, reason phrase: Request-URI Too Large
- Langage dominant
- Java
- Étoiles
- 913
- Forks
- 466
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
`org.apache.http.client.HttpResponseException: status code: 414, reason phrase: Request-URI Too Large
at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:261)
at com.offbytwo.jenkins.model.Job.build(Job.java:151)
at com.offbytwo.jenkins.model.Job.build(Job.java:113)`
when build job with params, The parameter is a very long value, there will be the following error.In the source code, although the operation is a post request, he stitched the parameters on the url.
` public QueueReference build(Map params, Map fileParams, boolean crumbFlag) throws IOException {
String qs = join(Collections2.transform(params.entrySet(), new MapEntryToQueryStringPair()), "&");
ExtractHeader location = client.post(url + "buildWithParameters?" + qs,null, ExtractHeader.class, fileParams, crumbFlag);
return new QueueReference(location.getLocation());
}`
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans Job.java, au niveau de la méthode build(Map params, ...), et suivez son appel à JenkinsHttpClient.post. Reproduisez l’échec avec une valeur de paramètre suffisamment longue pour déclencher HTTP 414, puis vérifiez que les builds paramétrés ne placent plus la valeur complète dans l’URI de la requête et s’achèvent correctement.
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é
- Clairement spécifiée
- Accessibilité débutants
- 45/100