1 override of HttpContext
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpRequest.cs (1)
47public override HttpContext HttpContext => _context;
46 references to HttpContext
InMemory.FunctionalTests (1)
TestTransport\RequestExtensions.cs (1)
12return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Logging\HttpUtilityExtensions.cs (1)
40var endpoint = request.HttpContext.GetEndpoint();
Logging\IncomingHttpRouteUtility.cs (1)
42var endpoint = request.HttpContext.GetEndpoint();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (16)
Logging\HttpUtilityExtensionsTests.cs (3)
49mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 60mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 78mockHttpRequest.Setup(m => m.HttpContext).Returns(context);
Logging\IncomingHttpRouteUtilityTests.cs (11)
53mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 91mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 131mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 173mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 215mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 262mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 303mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 351mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 396mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 434mockHttpRequest.Setup(m => m.HttpContext).Returns(context); 457mockHttpRequest.Setup(m => m.HttpContext).Returns(context);
Logging\RequestHeadersEnricherTests.cs (2)
48httpContextMock.SetupGet(c => c.Request.HttpContext).Returns(httpContextMock.Object); 257httpContextMock.SetupGet(c => c.Request.HttpContext).Returns(httpContextMock.Object);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingHttpRequestExtensions.cs (1)
23var context = Throw.IfNull(request).HttpContext;
Microsoft.AspNetCore.Http (6)
Features\FormFeature.cs (4)
208using (cancellationToken.Register((state) => ((HttpContext)state!).Abort(), _request.HttpContext)) 255_request.HttpContext.Response.RegisterForDispose, 363var hasInvokedMiddleware = _request.HttpContext.Items.ContainsKey("__AntiforgeryMiddlewareWithEndpointInvoked"); 364var hasInvalidToken = _request.HttpContext.Features.Get<IAntiforgeryValidationFeature>() is { IsValid: false };
Internal\BufferingHelper.cs (1)
22request.HttpContext.Response.RegisterForDispose(fileStream);
RequestFormReaderExtensions.cs (1)
32var features = request.HttpContext.Features;
Microsoft.AspNetCore.Http.Abstractions (5)
Extensions\RequestTrailerExtensions.cs (3)
32return request.HttpContext.Features.Get<IHttpRequestTrailersFeature>() != null; 43return request.HttpContext.Features.Get<IHttpRequestTrailersFeature>()?.Available == true; 55var feature = request.HttpContext.Features.Get<IHttpRequestTrailersFeature>();
HttpRequest.cs (2)
20/// Gets the <see cref="HttpContext"/> for this request. 178public IFormCollection? Form => _request.HttpContext.Features.Get<IFormFeature>()?.Form;
Microsoft.AspNetCore.Http.Extensions (9)
HttpRequestJsonExtensions.cs (9)
41var options = ResolveSerializerOptions(request.HttpContext); 68options ??= ResolveSerializerOptions(request.HttpContext); 71var (inputStream, usesTranscodingStream) = GetInputStream(request.HttpContext, encoding); 109var (inputStream, usesTranscodingStream) = GetInputStream(request.HttpContext, encoding); 147var (inputStream, usesTranscodingStream) = GetInputStream(request.HttpContext, encoding); 177var options = ResolveSerializerOptions(request.HttpContext); 206options ??= ResolveSerializerOptions(request.HttpContext); 209var (inputStream, usesTranscodingStream) = GetInputStream(request.HttpContext, encoding); 251var (inputStream, usesTranscodingStream) = GetInputStream(request.HttpContext, encoding);
Microsoft.AspNetCore.Http.Tests (1)
Internal\DefaultHttpRequestTests.cs (1)
138var requestFeature = request.HttpContext.Features.Get<IHttpRequestFeature>();
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerInputFormatter.cs (1)
132request.HttpContext.Response.RegisterForDispose(readStream);
XmlSerializerInputFormatter.cs (1)
116request.HttpContext.Response.RegisterForDispose(readStream);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Utilities.cs (1)
174return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
Microsoft.AspNetCore.TestHost.Tests (1)
Utilities.cs (1)
15return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
StartRouteBuilderUrlApp (1)
Program.cs (1)
24var env = req.HttpContext.RequestServices.GetRequiredService<IHostEnvironment>();