Skip to content

Commit

Permalink
[browser][http] Fix HttpClientHandler "Supports*" properties regressi…
Browse files Browse the repository at this point in the history
…ons (dotnet#39889)

* [browser][http] Fix HttpClientHandler "Supports*" properties regressions

* Also needs implementing on SocketsHttpHandler.

On the SocketsHttpHandler we will default to `true` here.

```
        internal bool SupportsAutomaticDecompression => true;
        internal bool SupportsProxy => true;
        internal bool SupportsRedirectConfiguration => true;
```

* Should be internal accessor
  • Loading branch information
kjpou1 authored Jul 28, 2020
1 parent c40de2b commit 1d05f27
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public SslClientAuthenticationOptions SslOptions
set => throw new PlatformNotSupportedException();
}

public bool SupportsAutomaticDecompression => false;
public bool SupportsProxy => false;
public bool SupportsRedirectConfiguration => false;

private Dictionary<string, object?>? _properties;
public IDictionary<string, object?> Properties => _properties ??= new Dictionary<string, object?>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

public virtual bool SupportsAutomaticDecompression => true;
public virtual bool SupportsProxy => true;
public virtual bool SupportsRedirectConfiguration => true;
public virtual bool SupportsAutomaticDecompression => _underlyingHandler.SupportsAutomaticDecompression;
public virtual bool SupportsProxy => _underlyingHandler.SupportsProxy;
public virtual bool SupportsRedirectConfiguration => _underlyingHandler.SupportsRedirectConfiguration;

public bool UseCookies
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ public TimeSpan Expect100ContinueTimeout
}
}

internal bool SupportsAutomaticDecompression => true;
internal bool SupportsProxy => true;
internal bool SupportsRedirectConfiguration => true;

public IDictionary<string, object?> Properties =>
_settings._properties ?? (_settings._properties = new Dictionary<string, object?>());

Expand Down

0 comments on commit 1d05f27

Please sign in to comment.