File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
localstack-core/localstack/utils Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,22 @@ def java_system_properties_proxy() -> dict[str, str]:
26
26
"""
27
27
props = {}
28
28
29
- for scheme , default_port , var in [
29
+ for scheme , default_port , proxy_url in [
30
30
("http" , "80" , config .OUTBOUND_HTTP_PROXY ),
31
31
("https" , "443" , config .OUTBOUND_HTTPS_PROXY ),
32
32
]:
33
- if var :
34
- netloc = urlparse (var ).netloc
35
- url = netloc .split (":" )
36
- if len (url ) == 2 :
37
- hostname , port = url
38
- else :
39
- hostname , port = url [0 ], default_port
40
-
41
- props [f"{ scheme } .proxyHost" ] = hostname
42
- props [f"{ scheme } .proxyPort" ] = port
33
+ if proxy_url :
34
+ parsed_url = urlparse (proxy_url )
35
+
36
+ port : int | None = parsed_url .port
37
+
7026
if port is None :
38
+ if scheme == "https" :
39
+ port = 443
40
+ else :
41
+ port = 80
42
+
43
+ props [f"{ scheme } .proxyHost" ] = parsed_url .hostname
44
+ props [f"{ scheme } .proxyPort" ] = str (port )
43
45
44
46
return props
45
47
You can’t perform that action at this time.
0 commit comments