Skip to content

Commit 70ff150

Browse files
Don't fail constructing WebProxyData if retrieving proxy data from the registry fails with DllNotFoundException. We don't construct it on Unity AOT profile anyway, and it's better for it to work without proxy support than not work at all.
Release notes: � Universal Windows Platform: Fixed HttpWebRequest throwing DllNotFoundException on IL2CPP scripting backend (case 989588).
1 parent ca762c2 commit 70ff150

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,22 @@ public WebProxyData GetWebProxyData ()
4646
WebProxyData data;
4747

4848
// TODO: Could re-use some pieces from _AutoWebProxyScriptEngine.cs
49-
if (IsWindows ()) {
50-
data = InitializeRegistryGlobalProxy ();
49+
try {
50+
if (IsWindows ()) {
51+
data = InitializeRegistryGlobalProxy ();
52+
if (data != null)
53+
return data;
54+
}
55+
56+
data = ReadEnvVariables ();
5157
if (data != null)
5258
return data;
5359
}
60+
catch (DllNotFoundException) {
61+
// This path will be hit on UWP since we're not allowed to read from registry
62+
}
5463

55-
data = ReadEnvVariables ();
56-
return data ?? new WebProxyData ();
64+
return new WebProxyData ();
5765
}
5866

5967
WebProxyData ReadEnvVariables ()

0 commit comments

Comments
 (0)