Skip to content

Commit 2bb4214

Browse files
authored
Add scheme before constructing URL object (the env variable of where it comes from may not have scheme set). (#148)
1 parent aaafea9 commit 2bb4214

File tree

1 file changed

+3
-0
lines changed
  • imagetool/src/main/java/com/oracle/weblogic/imagetool/util

1 file changed

+3
-0
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/Utils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public static void setProxyIfRequired(String httpProxyUrl, String httpsProxyUrl,
156156
}
157157

158158
private static void setSystemProxy(String proxyUrl, String protocolToSet) throws IOException {
159+
if (!proxyUrl.toLowerCase().startsWith(protocolToSet)) {
160+
proxyUrl = protocolToSet + "://" + proxyUrl;
161+
}
159162
URL url = new URL(proxyUrl);
160163
String host = url.getHost();
161164
int port = url.getPort() == -1 ? url.getDefaultPort() : url.getPort();

0 commit comments

Comments
 (0)