jenkinsci / jenkinsci/java-client-api
Job.build(Map<String, String> params) results in HTTP 414 (URI too long)
- Ngôn ngữ chính
- Java
- Star
- 913
- Fork
- 466
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I've had problems with requests for a parameterized job build:
```
org.apache.http.client.HttpResponseException: Request-URI Too Long
at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:232)
at com.offbytwo.jenkins.model.Job.build(Job.java:125)
at com.offbytwo.jenkins.model.Job.build(Job.java:112)
```
Looking at the code, I noticed that `Job.build` encodes the job parameter/values in the URL.
This can result in a very long URL that exceeds the server's max URL size.
I worked around this problem outside of the library by submitting a POST request where the job parameter/values are passed as form data instead of encoded in the url.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start in Job.java at the parameterized Job.build overloads and follow the request into JenkinsHttpClient.post. Check how parameter names and values are currently encoded, then compare that with the reported form-data workaround. Done means parameterized builds use a request representation that avoids HTTP 414 for long values while preserving the parameters.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100