Skip to content

Commit

Permalink
Added undefined to Proxy setup #3260
Browse files Browse the repository at this point in the history
  • Loading branch information
lorriborri committed Jul 2, 2024
1 parent fd20b6e commit 13b0354
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public AdapterExecutionResult startPreparation() throws IOException {
}

LOG.info("Start preparation with following modules: {}", modules);
setUpSystemProperties(context);

for (PrepareWrapperModule module : modules) {
if (!module.isEnabled()) {
Expand All @@ -64,7 +65,6 @@ public AdapterExecutionResult startPreparation() throws IOException {
if (module.isResponsibleToPrepare(context)) {
LOG.debug("Module: {} is responsible and will be used to prepare", module);

setUpSystemProperties(context);
module.prepare(context);

PrepareResult result = new PrepareResult(PrepareStatus.OK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
@Component
public class PrepareWrapperProxySupport {

@Value("${" + KEY_PDS_HTTPS_PROXY + "}")
private final static String UNDEFINED = "";

@Value("${" + KEY_PDS_HTTPS_PROXY + ":" + UNDEFINED +"}")
String httpsProxy;

@Value("${" + KEY_PDS_NO_PROXY + "}")
@Value("${" + KEY_PDS_NO_PROXY + ":" + UNDEFINED +"}")
String noProxy;

@Value("${" + KEY_PDS_PREPARE_PROXY_ENABLED + ":false}")
Expand Down Expand Up @@ -59,7 +61,12 @@ private String resolveHostname() {
}

private String resolvePort() {
String port = httpsProxy.split(":")[1];
String [] splitProxy = httpsProxy.split(":");
if (splitProxy.length < 2) {
throw new IllegalStateException(
"No port number is set. Please set the environment variable: " + KEY_PDS_HTTPS_PROXY + " with the format: <hostname>:<port>");
}
String port = splitProxy[1];
assertPort(port);
return port;
}
Expand Down

0 comments on commit 13b0354

Please sign in to comment.