[JENKINS-72343] Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration #8700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "Validate Proxy" button in "Manage > Plugins > Advanced settings > HTTP Proxy Configuration" currently accepts only
HTTP_OK
(200) as valid:jenkins/core/src/main/java/hudson/ProxyConfiguration.java
Lines 579 to 580 in 51c5fa2
This small PR allows accepting all status code below
HTTP_BAD_REQUEST
(400) as valid responses and add the status code in the response to the user:See JENKINS-72343.
Testing done
Checked that it works by running Jenkins locally with
mvn -pl war jetty:run
.Ran a build with tests locally with
mvn -am -pl war,bom clean install
.There is no test for this client side functionality, I don't think one should be added.
Proposed changelog entries
(Not sure it worth being mentioned in changelog)
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist