Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
fix:[CDS-81070]: Jenkins Job Parameters encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
puthrayaharness committed Oct 11, 2023
1 parent 99e5fa7 commit 6f5fd54
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -144,9 +146,8 @@ public QueueReference build(Map<String, String> params, Map<String, File> filePa
*/
public QueueReference build(Map<String, String> params, Map<String, File> fileParams, boolean crumbFlag) throws IOException {
String qs = params.entrySet().stream()
.map(s -> s.getKey() + "=" + s.getValue())
.collect(Collectors.joining("&"));
// String qs = join(Collections2.transform(params.entrySet(), new MapEntryToQueryStringPair()), "&");
.map(s -> URLEncoder.encode(s.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(s.getValue(), StandardCharsets.UTF_8))
.collect(Collectors.joining("&"));
ExtractHeader location = client.post(url + "buildWithParameters?" + qs,null, ExtractHeader.class, fileParams, crumbFlag);
return new QueueReference(location.getLocation());
}
Expand Down

0 comments on commit 6f5fd54

Please sign in to comment.