Skip to content
Merged
3 changes: 2 additions & 1 deletion src/Servers/Kestrel/test/FunctionalTests/ResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ await connection.Send(
}
}

[Fact]
[ConditionalFact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2181", FlakyOn.All)]
public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseChunks()
{
var chunkSize = 64 * 128 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ await WithConnectionAsync(
Assert.Same(httpOptions.Credentials, httpClientHandler.Credentials);
}

[Fact]
public void HttpOptionsCannotSetNullCookieContainer()
{
var httpOptions = new HttpConnectionOptions();
Assert.NotNull(httpOptions.Cookies);
Assert.Throws<ArgumentNullException>(() => httpOptions.Cookies = null);
}

[Fact]
public async Task HttpRequestAndErrorResponseLogged()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,14 @@ private HttpClient CreateHttpClient()
{
httpClientHandler.Proxy = _httpConnectionOptions.Proxy;
}
if (_httpConnectionOptions.Cookies != null)

// Only access HttpClientHandler.ClientCertificates and HttpClientHandler.CookieContainer
// if the user has configured those options
// Some variants of Mono do not support client certs or cookies and will throw NotImplementedException
if (_httpConnectionOptions.Cookies.Count > 0)
{
httpClientHandler.CookieContainer = _httpConnectionOptions.Cookies;
}

// Only access HttpClientHandler.ClientCertificates if the user has configured client certs
// Mono does not support client certs and will throw NotImplementedException
// https://github.com/aspnet/SignalR/issues/2232
var clientCertificates = _httpConnectionOptions.ClientCertificates;
if (clientCertificates?.Count > 0)
Expand Down