1 override of Protocol
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpRequest.cs (1)
127public override string Protocol
28 writes to Protocol
HttpAbstractions.SampleApp (1)
Program.cs (1)
26request.Protocol = "HTTP/2";
InMemory.FunctionalTests (1)
ChunkedResponseTests.cs (1)
89httpContext.Request.Protocol = "HTTP/2"; // Doesn't support chunking. This change should be ignored.
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
297ctx.Request.Protocol = "HTTP/1.0";
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
484context.Request.Protocol = http2 ? "HTTP/2" : "HTTP/1.1";
Microsoft.AspNetCore.Hosting.Tests (9)
HostingApplicationDiagnosticsTests.cs (5)
240c.Request.Protocol = "1.1"; 299c.Request.Protocol = "1.1"; 359c.Request.Protocol = "1.1"; 414c.Request.Protocol = "1.1"; 1049c.Request.Protocol = "1.1";
HostingMetricsTests.cs (4)
36httpContext.Request.Protocol = HttpProtocol.Http11; 48httpContext.Request.Protocol = HttpProtocol.Http2; 63httpContext.Request.Protocol = HttpProtocol.Http3; 134httpContext.Request.Protocol = HttpProtocol.Http11;
Microsoft.AspNetCore.Http.Tests (4)
ApplicationBuilderTests.cs (1)
90httpContext.Request.Protocol = "HTTP/2";
DefaultHttpContextTests.cs (1)
308context.Request.Protocol = "HTTP/2";
Internal\DefaultHttpRequestTests.cs (2)
273context.Request.Protocol = "HTTP/2"; 329context.Request.Protocol = "HTTP/2";
Microsoft.AspNetCore.HttpLogging.Tests (8)
HttpLoggingMiddlewareTests.cs (2)
1248httpContext.Request.Protocol = "HTTP/1.1"; 1956httpContext.Request.Protocol = "HTTP/1.0";
W3CLoggingMiddlewareTests.cs (6)
55httpContext.Request.Protocol = "HTTP/1.0"; 82httpContext.Request.Protocol = "HTTP/1.0"; 126httpContext.Request.Protocol = "HTTP/1.0"; 168httpContext.Request.Protocol = "HTTP/1.0"; 199httpContext.Request.Protocol = "HTTP/1.0"; 246httpContext.Request.Protocol = "HTTP/1.0";
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
28context.Request.Protocol = "http/1.0";
Microsoft.AspNetCore.TestHost (2)
ClientHandler.cs (1)
114req.Protocol = HttpProtocol.GetHttpProtocol(request.Version);
HttpContextBuilder.cs (1)
40request.Protocol = HttpProtocol.Http11;
67 references to Protocol
Http2SampleApp (1)
Startup.cs (1)
23return context.Response.WriteAsync("Hello World! " + context.Request.Protocol);
Http3SampleApp (1)
Startup.cs (1)
26await context.Response.WriteAsync($"Hello World! {context.Request.Protocol} {context.Connection.ClientCertificate?.Subject}");
InMemory.FunctionalTests (1)
Http2\TlsTests.cs (1)
47return context.Response.WriteAsync("hello world " + context.Request.Protocol);
InProcessWebSite (3)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (3)
113await ctx.Response.WriteAsync(ctx.Request.Protocol); 296Assert.Equal("HTTP/1.1", ctx.Request.Protocol); 298Assert.Equal("HTTP/1.0", ctx.Request.Protocol);
Interop.FunctionalTests (1)
Http2WebSocketInteropTests.cs (1)
61Assert.Equal(expectedVersion, context.Request.Protocol);
Microsoft.AspNetCore.Authentication.Negotiate (3)
NegotiateHandler.cs (3)
63private bool IsSupportedProtocol => HttpProtocol.IsHttp11(Request.Protocol) || HttpProtocol.IsHttp10(Request.Protocol); 307Logger.ProtocolNotSupported(Request.Protocol);
Microsoft.AspNetCore.Authentication.Negotiate.Test (6)
EventTests.cs (1)
444Assert.Equal("HTTP/1.1", context.Request.Protocol); // Not HTTP/2
NegotiateHandlerTests.cs (5)
409Assert.Equal("HTTP/1.1", context.Request.Protocol); 416Assert.Equal("HTTP/2", context.Request.Protocol); 429Assert.Equal("HTTP/1.1", context.Request.Protocol); // Not HTTP/2 443Assert.Equal("HTTP/1.1", context.Request.Protocol); // Not HTTP/2 455Assert.Equal("HTTP/1.1", context.Request.Protocol); // Not HTTP/2
Microsoft.AspNetCore.HostFiltering (2)
HostFilteringMiddleware.cs (2)
121_logger.RequestRejectedMissingHost(context.Request.Protocol); 125_logger.RequestAllowedMissingHost(context.Request.Protocol);
Microsoft.AspNetCore.Hosting (7)
Internal\HostingApplicationDiagnostics.cs (1)
65context.MetricsTagsFeature.Protocol = httpContext.Request.Protocol;
Internal\HostingRequestFinishedLog.cs (3)
394 => new KeyValuePair<string, object?>(nameof(request.Protocol), request.Protocol), 66_cachedToString = $"Request finished {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {response.StatusCode.ToString(CultureInfo.InvariantCulture)} {ValueOrEmptyMarker(response.ContentLength)} {EscapedValueOrEmptyMarker(response.ContentType)} {Elapsed.TotalMilliseconds.ToString("0.0000", CultureInfo.InvariantCulture)}ms";
Internal\HostingRequestStartingLog.cs (3)
250 => new KeyValuePair<string, object?>(nameof(_request.Protocol), _request.Protocol), 48_cachedToString = $"Request starting {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {EscapedValueOrEmptyMarker(request.ContentType)} {ValueOrEmptyMarker(request.ContentLength)}";
Microsoft.AspNetCore.Hosting.Tests (1)
Internal\HostingRequestStartLogTests.cs (1)
17mockRequest.Setup(request => request.Protocol).Returns("1.1");
Microsoft.AspNetCore.Http (4)
src\Shared\Debugger\HttpContextDebugFormatter.cs (4)
40if (!string.IsNullOrEmpty(request.Protocol)) 43sb.Append(request.Protocol); 62if (!string.IsNullOrEmpty(context.Request.Protocol)) 65sb.Append(context.Request.Protocol);
Microsoft.AspNetCore.HttpLogging (4)
HttpLoggingFields.cs (1)
47/// Flag for logging the HTTP Request <see cref="HttpRequest.Protocol"/>.
HttpLoggingMiddleware.cs (2)
114logContext.AddParameter(nameof(request.Protocol), request.Protocol);
W3CLoggingMiddleware.cs (1)
124shouldLog |= AddToList(elements, _protocolVersionIndex, request.Protocol);
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
89Assert.Equal("http/1.0", context.Request.Protocol);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (15)
Http2Tests.cs (9)
616Assert.Equal("HTTP/1.1", httpContext.Request.Protocol); 638Assert.Equal("HTTP/2", httpContext.Request.Protocol); 661Assert.Equal("HTTP/2", httpContext.Request.Protocol); 703Assert.Equal("HTTP/2", httpContext.Request.Protocol); 750Assert.Equal("HTTP/2", httpContext.Request.Protocol); 800Assert.Equal("HTTP/2", httpContext.Request.Protocol); 852Assert.Equal("HTTP/2", httpContext.Request.Protocol); 898Assert.Equal("HTTP/2", httpContext.Request.Protocol); 947Assert.Equal("HTTP/2", httpContext.Request.Protocol);
Http3Tests.cs (4)
31await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 59await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 99await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 134await httpContext.Response.WriteAsync(httpContext.Request.Protocol);
ResponseTrailersTests.cs (2)
27Assert.Equal("HTTP/1.1", httpContext.Request.Protocol); 45Assert.Equal("HTTP/2", httpContext.Request.Protocol);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Hubs.cs (1)
103return Context.GetHttpContext()?.Request?.Protocol ?? "unknown";
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\SpaProxy.cs (2)
170if ((HttpProtocol.IsHttp2(context.Request.Protocol) || HttpProtocol.IsHttp3(context.Request.Protocol))
Microsoft.AspNetCore.TestHost (2)
HttpContextBuilder.cs (2)
92if (HttpProtocol.IsHttp2(_httpContext.Request.Protocol) || 93HttpProtocol.IsHttp3(_httpContext.Request.Protocol))
Microsoft.AspNetCore.TestHost.Tests (5)
ClientHandlerTests.cs (1)
50Assert.Equal(HttpProtocol.Http11, context.Request.Protocol);
HttpContextBuilderTests.cs (1)
31Assert.Equal(HttpProtocol.Http11, context.Request.Protocol);
TestClientTests.cs (3)
946protocol = ctx.Request.Protocol; 972protocol = ctx.Request.Protocol; 999protocol = ctx.Request.Protocol;
Negotiate.Client (1)
Controllers\AuthTestController.cs (1)
357default: throw new NotImplementedException(Request.Protocol);
NegotiateAuthSample (1)
Startup.cs (1)
58await context.Response.WriteAsync($"Authenticated? {user.IsAuthenticated}, Name: {user.Name}, Protocol: {context.Request.Protocol}");
Sockets.FunctionalTests (5)
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (2)
76return context.Response.WriteAsync("hello world " + context.Request.Protocol); 104return context.Response.WriteAsync("hello world " + context.Request.Protocol);
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (3)
73return context.Response.WriteAsync("hello world " + context.Request.Protocol); 130await context.Response.WriteAsync("hello world " + context.Request.Protocol); 181await context.Response.WriteAsync("hello world " + context.Request.Protocol);