@@ -51,13 +51,13 @@ public async Task ConnectAsync(Uri uri, HttpMessageInvoker? handler, Cancellatio
51
51
bool disposeHandler = true ;
52
52
try
53
53
{
54
- if ( options . Version . Major >= 3 && options . VersionPolicy != HttpVersionPolicy . RequestVersionOrLower )
54
+ if ( options . HttpVersion . Major >= 3 && options . HttpVersionPolicy != HttpVersionPolicy . RequestVersionOrLower )
55
55
{
56
56
throw new Exception ( ) ;
57
57
}
58
58
59
59
var request = new HttpRequestMessage ( HttpMethod . Get , uri ) ;
60
- if ( options . Version . Major >= 2 || ( options . VersionPolicy == HttpVersionPolicy . RequestVersionOrHigher ) )
60
+ if ( options . HttpVersion . Major >= 2 || ( options . HttpVersionPolicy == HttpVersionPolicy . RequestVersionOrHigher ) )
61
61
{
62
62
request . Version = new Version ( 2 , 0 ) ;
63
63
}
@@ -108,8 +108,8 @@ public async Task ConnectAsync(Uri uri, HttpMessageInvoker? handler, Cancellatio
108
108
catch ( HttpRequestException ex )
109
109
{
110
110
if ( ex . Data . Contains ( "SETTINGS_ENABLE_CONNECT_PROTOCOL" ) && request . Version . Major == 2
111
- && ( options . Version . Major == 2 && options . VersionPolicy == HttpVersionPolicy . RequestVersionOrLower
112
- || options . Version . Major == 1 && options . VersionPolicy == HttpVersionPolicy . RequestVersionOrHigher ) )
111
+ && ( options . HttpVersion . Major == 2 && options . HttpVersionPolicy == HttpVersionPolicy . RequestVersionOrLower
112
+ || options . HttpVersion . Major == 1 && options . HttpVersionPolicy == HttpVersionPolicy . RequestVersionOrHigher ) )
113
113
{
114
114
request . Version = new Version ( 1 , 1 ) ;
115
115
}
@@ -343,17 +343,17 @@ static int ParseWindowBits(ReadOnlySpan<char> value)
343
343
/// <param name="options">The options controlling the request.</param>
344
344
private static void AddWebSocketHeaders ( HttpRequestMessage request , string secKey , ClientWebSocketOptions options )
345
345
{
346
- request . Version = options . Version ;
346
+ request . Version = options . HttpVersion ;
347
347
// always exact because we handle downgrade here
348
348
request . VersionPolicy = HttpVersionPolicy . RequestVersionExact ;
349
349
350
- if ( options . Version == HttpVersion . Version11 )
350
+ if ( options . HttpVersion == HttpVersion . Version11 )
351
351
{
352
352
request . Headers . TryAddWithoutValidation ( HttpKnownHeaderNames . Connection , HttpKnownHeaderNames . Upgrade ) ;
353
353
request . Headers . TryAddWithoutValidation ( HttpKnownHeaderNames . Upgrade , "websocket" ) ;
354
354
request . Headers . TryAddWithoutValidation ( HttpKnownHeaderNames . SecWebSocketKey , secKey ) ;
355
355
}
356
- else if ( options . Version == HttpVersion . Version20 )
356
+ else if ( options . HttpVersion == HttpVersion . Version20 )
357
357
{
358
358
request . Method = HttpMethod . Connect ;
359
359
request . Headers . Protocol = "websocket" ;
@@ -408,7 +408,7 @@ static string GetDeflateOptions(WebSocketDeflateOptions options)
408
408
409
409
private static void ValidateResponse ( HttpResponseMessage response , string secValue , ClientWebSocketOptions options )
410
410
{
411
- if ( options . Version == HttpVersion . Version11 )
411
+ if ( options . HttpVersion == HttpVersion . Version11 )
412
412
{
413
413
if ( response . StatusCode != HttpStatusCode . SwitchingProtocols )
414
414
{
@@ -420,7 +420,7 @@ private static void ValidateResponse(HttpResponseMessage response, string secVal
420
420
ValidateHeader ( response . Headers , HttpKnownHeaderNames . Upgrade , "websocket" ) ;
421
421
ValidateHeader ( response . Headers , HttpKnownHeaderNames . SecWebSocketAccept , secValue ) ;
422
422
}
423
- else if ( options . Version == HttpVersion . Version20 )
423
+ else if ( options . HttpVersion == HttpVersion . Version20 )
424
424
{
425
425
if ( response . StatusCode != HttpStatusCode . OK )
426
426
{
0 commit comments