[JENKINS-57125] Trim the value and request parameter options #112
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.
Relevant Issues
The reason for this issue is because the plugin's function splits the
valueStr
by commas (,
) and does not account for possible spaces between them.Notice the space prefix in the strings. Because of this when a parameter is passed using
/buildWithParameters
without the space prefix, it gets ignored.Here
option1
gets accepted, howeveroption2
gets ignored. To solve this I've split thevalueStr
by commas and taken spaces into consideration. Additionally I have also trimmed the values that are passed by the user.Workaround
The temporary solution is to remove all the spaces from the options string in the job configuration, if that isn't possible you can pass the value to the endpoint along with the space (
%20
) as shown below.Testing done
No valid crumb was included
error while trying to make a POST request, so I disabled CSRF protection to get around this.curl
command.Submitter checklist