Skip to content

Commit

Permalink
IsSupported reports SocketsHttpHandler availability on different plat…
Browse files Browse the repository at this point in the history
…forms (dotnet#40271)

Fixes dotnet#39489
  • Loading branch information
alnikola authored and Jacksondr5 committed Aug 10, 2020
1 parent b2b4ce3 commit 2a27143
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libraries/System.Net.Http/ref/System.Net.Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ protected override void Dispose(bool disposing) { }
public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler
{
public SocketsHttpHandler() { }
public static bool IsSupported { get { throw null; } }
public bool AllowAutoRedirect { get { throw null; } set { } }
public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } }
public System.Net.Connections.ConnectionFactory? ConnectionFactory { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace System.Net.Http
{
public sealed class SocketsHttpHandler : HttpMessageHandler
{
public static bool IsSupported => false;

public bool UseCookies
{
get => throw new PlatformNotSupportedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ private void CheckDisposedOrStarted()
}
}

public static bool IsSupported => true;

public bool UseCookies
{
get => _settings._useCookies;
Expand Down

0 comments on commit 2a27143

Please sign in to comment.