126 references to HttpVersionPolicy
HttpClientApp (1)
Program.cs (1)
20
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
IIS.FunctionalTests (9)
Http3Tests.cs (9)
49
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
64
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
69
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
89
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
108
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
122
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
135
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
151
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
168
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
192
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
Http2\Http2EndToEndTests.cs (1)
69
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
KestrelMetricsTests.cs (5)
571
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
650
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
728
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
809
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
897
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
Interop.FunctionalTests (63)
Http2\Http2RequestTests.cs (4)
128
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
185
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
211
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
295
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
Http2WebSocketInteropTests.cs (11)
28
new object[] { "http", "1.1",
HttpVersionPolicy
.RequestVersionExact, HttpProtocols.Http1, "HTTP/1.1" },
29
new object[] { "http", "2.0",
HttpVersionPolicy
.RequestVersionExact, HttpProtocols.Http2, "HTTP/2" },
30
new object[] { "http", "1.1",
HttpVersionPolicy
.RequestVersionOrHigher, HttpProtocols.Http1AndHttp2, "HTTP/1.1" }, // No TLS/APLN, Can't upgrade
31
new object[] { "http", "2.0",
HttpVersionPolicy
.RequestVersionOrLower, HttpProtocols.Http1AndHttp2, "HTTP/1.1" }, // No TLS/APLN, Downgrade
36
list.Add(new object[] { "https", "1.1",
HttpVersionPolicy
.RequestVersionExact, HttpProtocols.Http1, "HTTP/1.1" });
37
list.Add(new object[] { "https", "2.0",
HttpVersionPolicy
.RequestVersionExact, HttpProtocols.Http2, "HTTP/2" });
38
list.Add(new object[] { "https", "1.1",
HttpVersionPolicy
.RequestVersionOrHigher, HttpProtocols.Http1AndHttp2, "HTTP/2" }); // Upgrade
39
list.Add(new object[] { "https", "2.0",
HttpVersionPolicy
.RequestVersionOrLower, HttpProtocols.Http1AndHttp2, "HTTP/2" });
40
list.Add(new object[] { "https", "2.0",
HttpVersionPolicy
.RequestVersionOrLower, HttpProtocols.Http1, "HTTP/1.1" }); // Downgrade
49
public async Task HttpVersionNegotationWorks(string scheme, string clientVersion,
HttpVersionPolicy
clientPolicy, HttpProtocols serverProtocols, string expectedVersion)
145
wsClient.Options.HttpVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
Http3\Http3RequestTests.cs (37)
91
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
150
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
252
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
296
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
377
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
420
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
491
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
562
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
621
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
677
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
727
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
817
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
853
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
864
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
913
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
926
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
942
request3.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
1016
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1113
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1259
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1318
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1372
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1424
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1434
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1491
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1502
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1543
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1561
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1605
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1665
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1721
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1841
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1887
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1964
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
2041
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
2141
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
2194
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
Http3\Http3TlsTests.cs (7)
58
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
105
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
147
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
196
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
246
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
324
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
475
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
HttpClientHttp2InteropTests.cs (4)
1632
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1677
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1692
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1701
VersionPolicy =
HttpVersionPolicy
.RequestVersionExact,
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (9)
Http3Tests.cs (9)
43
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
72
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
77
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
113
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
147
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
175
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
205
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
230
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
254
client.DefaultVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (6)
WebHostTests.cs (6)
81
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
247
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
261
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
318
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
331
request2.VersionPolicy =
HttpVersionPolicy
.RequestVersionOrHigher;
354
request1.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (3)
HubConnectionTests.cs (3)
1771
o.HttpVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1890
o.HttpVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
1932
o.HttpVersionPolicy =
HttpVersionPolicy
.RequestVersionExact;
System.Net.Http (19)
System\Net\Http\HttpClient.cs (2)
30
private
HttpVersionPolicy
_defaultVersionPolicy = HttpRequestMessage.DefaultVersionPolicy;
71
public
HttpVersionPolicy
DefaultVersionPolicy
System\Net\Http\HttpRequestMessage.cs (4)
16
internal static
HttpVersionPolicy
DefaultVersionPolicy =>
HttpVersionPolicy
.RequestVersionOrLower;
31
private
HttpVersionPolicy
_versionPolicy;
50
public
HttpVersionPolicy
VersionPolicy
System\Net\Http\HttpTelemetry.cs (3)
38
private void RequestStart(string scheme, string host, int port, string pathAndQuery, byte versionMajor, byte versionMinor,
HttpVersionPolicy
versionPolicy)
254
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3, string? arg4, byte arg5, byte arg6,
HttpVersionPolicy
arg7)
300
Size = sizeof(
HttpVersionPolicy
)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (8)
420
(request.Version.Major >= 3 || (request.VersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher && IsSecure)) &&
446
if (request.Version.Major >= 3 && request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
453
(request.Version.Major >= 2 || (request.VersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher && IsSecure)) &&
454
(request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower || IsSecure)) // prefer HTTP/1.1 if connection is not secured and downgrade is possible
483
if (request.Version.Major >= 2 && request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
535
if (request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
725
if (request.Version.Major >= 2 && request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
730
if (request.Version.Major >= 2 || request.VersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
614
if (request.Version.Major >= 3 && request.VersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
589
if (request.VersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher)
System.Net.WebSockets.Client (9)
System\Net\WebSockets\ClientWebSocketOptions.cs (3)
31
private
HttpVersionPolicy
_versionPolicy =
HttpVersionPolicy
.RequestVersionOrLower;
62
public
HttpVersionPolicy
HttpVersionPolicy
System\Net\WebSockets\WebSocketHandle.Managed.cs (6)
54
if (options.HttpVersion.Major >= 2 || options.HttpVersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher)
71
bool tryDowngrade = uri.Scheme == UriScheme.Ws && (options.HttpVersion == HttpVersion.Version11 || options.HttpVersionPolicy ==
HttpVersionPolicy
.RequestVersionOrLower);
81
|| (options.HttpVersion == HttpVersion.Version11 && options.HttpVersionPolicy ==
HttpVersionPolicy
.RequestVersionOrHigher && uri.Scheme == UriScheme.Wss))
83
if (options.HttpVersion > HttpVersion.Version20 && options.HttpVersionPolicy !=
HttpVersionPolicy
.RequestVersionOrLower)
140
&& (options.HttpVersion == HttpVersion.Version11 || options.HttpVersionPolicy ==
HttpVersionPolicy
.RequestVersionOrLower))
383
request.VersionPolicy =
HttpVersionPolicy
.RequestVersionExact;