Skip to content

Commit

Permalink
Added URL encode to HTTP GET to check if target remote job is
Browse files Browse the repository at this point in the history
parameterized. Previously, a remote job with spaces in the name would
cause a failure while attempting to check for job parameters. This
caused each build trigger step to retry the parameterization check 5
times and then swallow the resulting AbortException.
  • Loading branch information
codykeeling committed Apr 29, 2014
1 parent 9260b10 commit 6a9aaab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ private boolean isRemoteJobParameterized(String jobName, AbstractBuild build, Bu
remoteServerUrl += "/api/json";

try {
JSONObject response = sendHTTPCall(remoteServerUrl, "GET", build, listener);
JSONObject response = sendHTTPCall(encodeValue(remoteServerUrl), "GET", build, listener);

if(response.getJSONArray("actions").size() >= 1){
isParameterized = true;
Expand Down

3 comments on commit 6a9aaab

@scottanderson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to cause the plugin to throw MalformedURLExceptions; https:// is converted to https%3A%2F%2F

@morficus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. It's probably overzealous to encode the entire URL. The only thing that could really have anything worth encoding in the job name (which is assigned just a few liens above).
Interesting that this problem hasn't come up before.

@scottanderson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with #5

Please sign in to comment.