Skip to content

Commit

Permalink
Blazor: Fixes not supported HTTP features (#1863)
Browse files Browse the repository at this point in the history
* catching PlatformNotSupportedException

* simplifying
  • Loading branch information
ealsur committed Sep 21, 2020
1 parent fc46b1d commit eb12cfe
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,19 @@ public static CosmosHttpClient CreateWithConnectionPolicy(
public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConnectionLimit, IWebProxy webProxy)
{
// https://docs.microsoft.com/en-us/archive/blogs/timomta/controlling-the-number-of-outgoing-connections-from-httpclient-net-core-or-full-framework
return new HttpClientHandler
try
{
Proxy = webProxy,
MaxConnectionsPerServer = gatewayModeMaxConnectionLimit
};
return new HttpClientHandler
{
Proxy = webProxy,
MaxConnectionsPerServer = gatewayModeMaxConnectionLimit
};
}
catch (PlatformNotSupportedException)
{
// Proxy and MaxConnectionsPerServer are not supported on some platforms.
return new HttpClientHandler();
}
}

private static HttpMessageHandler CreateHttpMessageHandler(
Expand Down

0 comments on commit eb12cfe

Please sign in to comment.