Skip to content

Commit 7a9ba85

Browse files
Merge pull request #870 from Unity-Technologies/fix-http-web-request-uwp
Fix HttpWebRequest on UWP and Xbox One (case 989588)
2 parents cb33cc6 + 70ff150 commit 7a9ba85

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)