Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Katya Sokolova committed Jul 12, 2022
1 parent 73968ec commit 4dbe1c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ internal ClientWebSocketOptions() { }
public System.Net.Security.RemoteCertificateValidationCallback? RemoteCertificateValidationCallback { get { throw null; } set { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public bool UseDefaultCredentials { get { throw null; } set { } }
public System.Version HttpVersion { get { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
set { } }
public System.Net.Http.HttpVersionPolicy HttpVersionPolicy { get { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
set { } }
public System.Version HttpVersion { get { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] set { } }
public System.Net.Http.HttpVersionPolicy HttpVersionPolicy { get { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] set { } }
public void AddSubProtocol(string subProtocol) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public void SetBuffer(int receiveBufferSize, int sendBufferSize) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public sealed class ClientWebSocketOptions
private Version _version = Net.HttpVersion.Version11;
private HttpVersionPolicy _versionPolicy = HttpVersionPolicy.RequestVersionOrLower;

internal ClientWebSocketOptions() { } // prevent external instantiation

#region HTTP Settings

public Version HttpVersion
{
get => _version;
Expand All @@ -52,10 +56,6 @@ public HttpVersionPolicy HttpVersionPolicy
}
}

internal ClientWebSocketOptions() { } // prevent external instantiation

#region HTTP Settings

[UnsupportedOSPlatform("browser")]
// Note that some headers are restricted like Host.
public void SetRequestHeader(string headerName, string? headerValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public async Task ConnectAsync(Uri uri, HttpMessageInvoker? invoker, Cancellatio
break;
}
catch (HttpRequestException ex) when
((ex.Data.Contains("SETTINGS_ENABLE_CONNECT_PROTOCOL") || ex.Data.Contains("HTTP2_ENABLED") || tryDowngrade)
((ex.Data.Contains("SETTINGS_ENABLE_CONNECT_PROTOCOL") || ex.Data.Contains("HTTP2_ENABLED"))
&& tryDowngrade
&& (options.HttpVersion == HttpVersion.Version11 || options.HttpVersionPolicy == HttpVersionPolicy.RequestVersionOrLower))
{
}
Expand Down

0 comments on commit 4dbe1c2

Please sign in to comment.