File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Servers/Kestrel/test/FunctionalTests
Http.Connections.Client/src Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,8 @@ await connection.Send(
733733 }
734734 }
735735
736- [ Fact ]
736+ [ ConditionalFact ]
737+ [ Flaky ( "https://github.com/aspnet/AspNetCore-Internal/issues/2181" , FlakyOn . All ) ]
737738 public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseChunks ( )
738739 {
739740 var chunkSize = 64 * 128 * 1024 ;
Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ await WithConnectionAsync(
8989 Assert . Same ( httpOptions . Credentials , httpClientHandler . Credentials ) ;
9090 }
9191
92+ [ Fact ]
93+ public void HttpOptionsCannotSetNullCookieContainer ( )
94+ {
95+ var httpOptions = new HttpConnectionOptions ( ) ;
96+ Assert . NotNull ( httpOptions . Cookies ) ;
97+ Assert . Throws < ArgumentNullException > ( ( ) => httpOptions . Cookies = null ) ;
98+ }
99+
92100 [ Fact ]
93101 public async Task HttpRequestAndErrorResponseLogged ( )
94102 {
Original file line number Diff line number Diff line change @@ -517,13 +517,14 @@ private HttpClient CreateHttpClient()
517517 {
518518 httpClientHandler . Proxy = _httpConnectionOptions . Proxy ;
519519 }
520- if ( _httpConnectionOptions . Cookies != null )
520+
521+ // Only access HttpClientHandler.ClientCertificates and HttpClientHandler.CookieContainer
522+ // if the user has configured those options
523+ // Some variants of Mono do not support client certs or cookies and will throw NotImplementedException
524+ if ( _httpConnectionOptions . Cookies . Count > 0 )
521525 {
522526 httpClientHandler . CookieContainer = _httpConnectionOptions . Cookies ;
523527 }
524-
525- // Only access HttpClientHandler.ClientCertificates if the user has configured client certs
526- // Mono does not support client certs and will throw NotImplementedException
527528 // https://github.com/aspnet/SignalR/issues/2232
528529 var clientCertificates = _httpConnectionOptions . ClientCertificates ;
529530 if ( clientCertificates ? . Count > 0 )
You can’t perform that action at this time.
0 commit comments