1 type derived from HttpContext
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
21public sealed class DefaultHttpContext : HttpContext
1372 references to HttpContext
Aspire.Dashboard (23)
Authentication\AspirePolicyEvaluator.cs (7)
33/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 36/// <param name="context">The <see cref="HttpContext"/>.</param> 38public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 84static AuthenticateResult DefaultAuthenticateResult(HttpContext context) 96/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 97/// <param name="context">The <see cref="HttpContext"/>.</param> 105public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
Components\Pages\Error.razor.cs (1)
16private HttpContext? HttpContext { get; set; }
DashboardEndpointsBuilder.cs (6)
30builder = endpoints.MapPost("/api/validatetoken", async (string token, HttpContext httpContext, IOptionsMonitor<DashboardOptions> dashboardOptions) => 37endpoints.MapGet("/api/signout", async (HttpContext httpContext) => 57endpoints.MapGet("/api/set-language", async (string? language, string? redirectUrl, [FromHeader(Name = "Accept-Language")] string? acceptLanguage, HttpContext httpContext) => 132HttpContext httpContext, 163HttpContext httpContext, 230private static async Task StreamNdjsonAsync(HttpContext httpContext, IAsyncEnumerable<string> items, CancellationToken cancellationToken)
Model\BrowserSecurityHeadersMiddleware.cs (1)
63public Task InvokeAsync(HttpContext context)
Model\ValidateTokenMiddleware.cs (3)
27public async Task InvokeAsync(HttpContext context) 69private static void RedirectAfterValidation(HttpContext context) 81public static async Task<bool> TryAuthenticateAsync(string incomingBrowserToken, HttpContext httpContext, IOptionsMonitor<DashboardOptions> dashboardOptions)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (5)
105private static async Task WriteUnsupportedContentTypeResponse(HttpContext httpContext, ILogger logger) 138public static async ValueTask<MessageBindable<TMessage>?> BindAsync(HttpContext context, ParameterInfo parameter) 186private static async Task<TMessage?> ReadOtlpJsonData<TMessage>(HttpContext httpContext) where TMessage : IMessage<TMessage>, new() 216public async Task ExecuteAsync(HttpContext httpContext) 249HttpContext httpContext,
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
52app.MapPost("/", async (HttpContext context) =>
Keycloak.Web (1)
AuthorizationHandler.cs (1)
10var httpContext = httpContextAccessor.HttpContext ??
Microsoft.Analyzers.Extra.Tests (1)
AsyncMethodWithoutCancellationTests.cs (1)
163new[] { Assembly.GetAssembly(typeof(HttpContext))! },
Microsoft.AspNetCore.Antiforgery (48)
AntiforgeryMiddleware.cs (2)
16public Task Invoke(HttpContext context) 39public async Task InvokeAwaited(HttpContext context)
IAntiforgery.cs (11)
19/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 25AntiforgeryTokenSet GetAndStoreTokens(HttpContext httpContext); 30/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 33/// Unlike <see cref="GetAndStoreTokens(HttpContext)"/>, this method has no side effect. The caller 37AntiforgeryTokenSet GetTokens(HttpContext httpContext); 43/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 48Task<bool> IsRequestValidAsync(HttpContext httpContext); 53/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 58Task ValidateRequestAsync(HttpContext httpContext); 63/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 64void SetCookieTokenAndHeader(HttpContext httpContext);
IAntiforgeryAdditionalDataProvider.cs (2)
28string GetAdditionalData(HttpContext context); 37bool ValidateAdditionalData(HttpContext context, string additionalData);
Internal\DefaultAntiforgery.cs (16)
40public AntiforgeryTokenSet GetAndStoreTokens(HttpContext httpContext) 77public AntiforgeryTokenSet GetTokens(HttpContext httpContext) 88public async Task<bool> IsRequestValidAsync(HttpContext httpContext) 143public async Task ValidateRequestAsync(HttpContext httpContext) 182private void ValidateTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet) 209public void SetCookieTokenAndHeader(HttpContext httpContext) 239private void SaveCookieTokenAndHeader(HttpContext httpContext, string cookieToken) 256private void CheckSSLConfig(HttpContext context) 266private static IAntiforgeryFeature GetAntiforgeryFeature(HttpContext httpContext) 278private IAntiforgeryFeature GetCookieTokens(HttpContext httpContext) 322private AntiforgeryToken? GetCookieTokenDoesNotThrow(HttpContext httpContext) 343private IAntiforgeryFeature GetTokensInternal(HttpContext httpContext) 360/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 361private void SetDoNotCacheHeaders(HttpContext httpContext) 430HttpContext httpContext, 451HttpContext httpContext,
Internal\DefaultAntiforgeryAdditionalDataProvider.cs (2)
14public string GetAdditionalData(HttpContext context) 20public bool ValidateAdditionalData(HttpContext context, string additionalData)
Internal\DefaultAntiforgeryTokenGenerator.cs (2)
37HttpContext httpContext, 107HttpContext httpContext,
Internal\DefaultAntiforgeryTokenStore.cs (3)
22public string? GetCookieToken(HttpContext httpContext) 36public async Task<AntiforgeryTokenSet> GetRequestTokensAsync(HttpContext httpContext) 79public void SaveCookieToken(HttpContext httpContext, string token)
Internal\IAntiforgeryTokenGenerator.cs (4)
23/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 26AntiforgeryToken GenerateRequestToken(HttpContext httpContext, AntiforgeryToken cookieToken); 38/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 46HttpContext httpContext,
Internal\IAntiforgeryTokenStore.cs (4)
10string? GetCookieToken(HttpContext httpContext); 15/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 17Task<AntiforgeryTokenSet> GetRequestTokensAsync(HttpContext httpContext); 19void SaveCookieToken(HttpContext httpContext, string token);
src\aspnetcore\src\Shared\HttpExtensions.cs (2)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 49internal static void ClearEndpoint(HttpContext context)
Microsoft.AspNetCore.AsyncState (6)
AsyncContextHttpContext.cs (2)
36var httpContext = _httpContextAccessor.HttpContext; 49var httpContext = _httpContextAccessor.HttpContext;
AsyncStateHttpContextExtensions.cs (1)
18/// scoped to the lifetime of <see cref="AspNetCore.Http.HttpContext"/> instances.
TypeWrapper.cs (3)
9/// We use this generic type to store values into <see cref="AspNetCore.Http.HttpContext.Features"/>. 12/// <see cref="AspNetCore.Http.HttpContext.Features"/> under type T (by the application or another library), 16/// <typeparam name="T">The type of the value to store into <see cref="AspNetCore.Http.HttpContext.Features"/>.</typeparam>
Microsoft.AspNetCore.Authentication (24)
AuthenticationHandler.cs (4)
31/// Gets or sets the <see cref="HttpContext"/>. 33protected HttpContext Context { get; private set; } = default!; 147public async Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 167/// Initializes the events object, called once per request by <see cref="InitializeAsync(AuthenticationScheme, HttpContext)"/>.
AuthenticationMiddleware.cs (2)
39/// <param name="context">The <see cref="HttpContext"/>.</param> 40public async Task Invoke(HttpContext context)
AuthenticationSchemeOptions.cs (1)
89public Func<HttpContext, string?>? ForwardDefaultSelector { get; set; }
Events\AccessDeniedContext.cs (2)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 20HttpContext context,
Events\BaseContext.cs (2)
19protected BaseContext(HttpContext context, AuthenticationScheme scheme, TOptions options) 43public HttpContext HttpContext { get; }
Events\HandleRequestContext.cs (2)
17/// <param name="context">The <see cref="HttpContext"/>.</param> 21HttpContext context,
Events\PrincipalContext.cs (1)
21protected PrincipalContext(HttpContext context, AuthenticationScheme scheme, TOptions options, AuthenticationProperties? properties)
Events\PropertiesContext.cs (1)
20protected PropertiesContext(HttpContext context, AuthenticationScheme scheme, TOptions options, AuthenticationProperties? properties)
Events\RedirectContext.cs (1)
22HttpContext context,
Events\RemoteAuthenticationContext.cs (1)
22HttpContext context,
Events\RemoteFailureContext.cs (2)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 21HttpContext context,
Events\ResultContext.cs (1)
22protected ResultContext(HttpContext context, AuthenticationScheme scheme, TOptions options)
Events\TicketReceivedContext.cs (2)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 21HttpContext context,
RemoteAuthenticationOptions.cs (1)
169public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom)
RequestPathBaseCookieBuilder.cs (1)
22public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom)
Microsoft.AspNetCore.Authentication.Abstractions (74)
AuthenticationHttpContextExtensions.cs (41)
20/// <param name="context">The <see cref="HttpContext"/> context.</param> 22public static Task<AuthenticateResult> AuthenticateAsync(this HttpContext context) => 28/// <param name="context">The <see cref="HttpContext"/> context.</param> 31public static Task<AuthenticateResult> AuthenticateAsync(this HttpContext context, string? scheme) => 38/// <param name="context">The <see cref="HttpContext"/> context.</param> 41public static Task ChallengeAsync(this HttpContext context, string? scheme) => 49/// <param name="context">The <see cref="HttpContext"/> context.</param> 51public static Task ChallengeAsync(this HttpContext context) => 59/// <param name="context">The <see cref="HttpContext"/> context.</param> 62public static Task ChallengeAsync(this HttpContext context, AuthenticationProperties? properties) => 69/// <param name="context">The <see cref="HttpContext"/> context.</param> 73public static Task ChallengeAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 80/// <param name="context">The <see cref="HttpContext"/> context.</param> 83public static Task ForbidAsync(this HttpContext context, string? scheme) => 91/// <param name="context">The <see cref="HttpContext"/> context.</param> 93public static Task ForbidAsync(this HttpContext context) => 101/// <param name="context">The <see cref="HttpContext"/> context.</param> 104public static Task ForbidAsync(this HttpContext context, AuthenticationProperties? properties) => 111/// <param name="context">The <see cref="HttpContext"/> context.</param> 115public static Task ForbidAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 121/// <param name="context">The <see cref="HttpContext"/> context.</param> 125public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal) => 132/// <param name="context">The <see cref="HttpContext"/> context.</param> 135public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal) => 142/// <param name="context">The <see cref="HttpContext"/> context.</param> 146public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal, AuthenticationProperties? properties) => 152/// <param name="context">The <see cref="HttpContext"/> context.</param> 157public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) => 164/// <param name="context">The <see cref="HttpContext"/> context.</param> 166public static Task SignOutAsync(this HttpContext context) => context.SignOutAsync(scheme: null, properties: null); 172/// <param name="context">The <see cref="HttpContext"/> context.</param> 175public static Task SignOutAsync(this HttpContext context, AuthenticationProperties? properties) => context.SignOutAsync(scheme: null, properties: properties); 180/// <param name="context">The <see cref="HttpContext"/> context.</param> 183public static Task SignOutAsync(this HttpContext context, string? scheme) => context.SignOutAsync(scheme, properties: null); 188/// <param name="context">The <see cref="HttpContext"/> context.</param> 192public static Task SignOutAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 198/// <param name="context">The <see cref="HttpContext"/> context.</param> 202public static Task<string?> GetTokenAsync(this HttpContext context, string? scheme, string tokenName) => 209/// <param name="context">The <see cref="HttpContext"/> context.</param> 212public static Task<string?> GetTokenAsync(this HttpContext context, string tokenName) => 216private static IAuthenticationService GetAuthenticationService(HttpContext context) =>
AuthenticationOptions.cs (5)
69/// Used as the default scheme by <see cref="IAuthenticationService.AuthenticateAsync(HttpContext, string)"/>. 74/// Used as the default scheme by <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 79/// Used as the default scheme by <see cref="IAuthenticationService.SignOutAsync(HttpContext, string, AuthenticationProperties)"/>. 84/// Used as the default scheme by <see cref="IAuthenticationService.ChallengeAsync(HttpContext, string, AuthenticationProperties)"/>. 89/// Used as the default scheme by <see cref="IAuthenticationService.ForbidAsync(HttpContext, string, AuthenticationProperties)"/>.
IAuthenticationHandler.cs (2)
17/// <param name="context">The <see cref="HttpContext"/> context for the current request.</param> 18Task InitializeAsync(AuthenticationScheme scheme, HttpContext context);
IAuthenticationHandlerProvider.cs (2)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 19Task<IAuthenticationHandler?> GetHandlerAsync(HttpContext context, string authenticationScheme);
IAuthenticationSchemeProvider.cs (10)
27/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.AuthenticateAsync(HttpContext, string)"/>. 31/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.AuthenticateAsync(HttpContext, string)"/>.</returns> 35/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.ChallengeAsync(HttpContext, string, AuthenticationProperties)"/>. 39/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.ChallengeAsync(HttpContext, string, AuthenticationProperties)"/>.</returns> 43/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.ForbidAsync(HttpContext, string, AuthenticationProperties)"/>. 47/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.ForbidAsync(HttpContext, string, AuthenticationProperties)"/>.</returns> 51/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 55/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>.</returns> 59/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignOutAsync(HttpContext, string, AuthenticationProperties)"/>. 63/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignOutAsync(HttpContext, string, AuthenticationProperties)"/>.</returns>
IAuthenticationService.cs (10)
17/// <param name="context">The <see cref="HttpContext"/>.</param> 20Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string? scheme); 26/// <param name="context">The <see cref="HttpContext"/>.</param> 30Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 36/// <param name="context">The <see cref="HttpContext"/>.</param> 40Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 45/// <param name="context">The <see cref="HttpContext"/>.</param> 50Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties); 55/// <param name="context">The <see cref="HttpContext"/>.</param> 59Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties);
TokenExtensions.cs (4)
120/// <param name="context">The <see cref="HttpContext"/> context.</param> 123public static Task<string?> GetTokenAsync(this IAuthenticationService auth, HttpContext context, string tokenName) 130/// <param name="context">The <see cref="HttpContext"/> context.</param> 134public static async Task<string?> GetTokenAsync(this IAuthenticationService auth, HttpContext context, string? scheme, string tokenName)
Microsoft.AspNetCore.Authentication.BearerToken (6)
BearerTokenExtensions.cs (4)
20/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 31/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 43/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 55/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />.
BearerTokenHandler.cs (1)
83private static JsonTypeInfo<AccessTokenResponse> ResolveAccessTokenJsonTypeInfo(HttpContext httpContext)
MessageReceivedContext.cs (1)
18HttpContext context,
Microsoft.AspNetCore.Authentication.Cookies (20)
CookieAuthenticationEvents.cs (1)
114private static bool IsCookieRedirectDisabledByMetadata(HttpContext context)
CookieSignedInContext.cs (1)
23HttpContext context,
CookieSigningInContext.cs (1)
24HttpContext context,
CookieSigningOutContext.cs (1)
22HttpContext context,
CookieSlidingExpirationContext.cs (1)
22public CookieSlidingExpirationContext(HttpContext context, AuthenticationScheme scheme, CookieAuthenticationOptions options,
CookieValidatePrincipalContext.cs (1)
21public CookieValidatePrincipalContext(HttpContext context, AuthenticationScheme scheme, CookieAuthenticationOptions options, AuthenticationTicket ticket)
ICookieManager.cs (3)
20string? GetRequestCookie(HttpContext context, string key); 29void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options); 37void DeleteCookie(HttpContext context, string key, CookieOptions options);
ITicketStore.cs (7)
34/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 37Task<string> StoreAsync(AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => StoreAsync(ticket, cancellationToken); 64Task RenewAsync(string key, AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => RenewAsync(key, ticket, cancellationToken); 85/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 88Task<AuthenticationTicket?> RetrieveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RetrieveAsync(key, cancellationToken); 109/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 112Task RemoveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RemoveAsync(key, cancellationToken);
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (4)
90public string? GetRequestCookie(HttpContext context, string key) 145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
Microsoft.AspNetCore.Authentication.Core (26)
AuthenticationHandlerProvider.cs (1)
37public async Task<IAuthenticationHandler?> GetHandlerAsync(HttpContext context, string authenticationScheme)
AuthenticationSchemeProvider.cs (10)
63/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.AuthenticateAsync(HttpContext, string)"/>. 67/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.AuthenticateAsync(HttpContext, string)"/>.</returns> 74/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.ChallengeAsync(HttpContext, string, AuthenticationProperties)"/>. 78/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.ChallengeAsync(HttpContext, string, AuthenticationProperties)"/>.</returns> 85/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.ForbidAsync(HttpContext, string, AuthenticationProperties)"/>. 89/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.ForbidAsync(HttpContext, string, AuthenticationProperties)"/>.</returns> 96/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 100/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>.</returns> 107/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignOutAsync(HttpContext, string, AuthenticationProperties)"/>. 111/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignOutAsync(HttpContext, string, AuthenticationProperties)"/>.</returns>
AuthenticationService.cs (10)
60/// <param name="context">The <see cref="HttpContext"/>.</param> 63public virtual async Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string? scheme) 104/// <param name="context">The <see cref="HttpContext"/>.</param> 108public virtual async Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 127/// <param name="context">The <see cref="HttpContext"/>.</param> 131public virtual async Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 150/// <param name="context">The <see cref="HttpContext"/>.</param> 155public virtual async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 193/// <param name="context">The <see cref="HttpContext"/>.</param> 197public virtual async Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties)
AuthenticationServiceImpl.cs (5)
19public override async Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string? scheme) 37public override async Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 52public override async Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 67public override async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 82public override async Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties)
Microsoft.AspNetCore.Authentication.OAuth (1)
Events\OAuthCreatingTicketContext.cs (1)
31HttpContext context,
Microsoft.AspNetCore.Authorization.Policy (19)
AuthorizationMiddleware.cs (2)
93/// <param name="context">The <see cref="HttpContext"/>.</param> 94public async Task Invoke(HttpContext context)
AuthorizationMiddlewareResultHandler.cs (1)
15public Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
IAuthorizationMiddlewareResultHandler.cs (2)
20/// <param name="context">The <see cref="HttpContext"/>.</param> 23Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult);
IPolicyEvaluator.cs (6)
17/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 20/// <param name="context">The <see cref="HttpContext"/>.</param> 22Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context); 28/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 29/// <param name="context">The <see cref="HttpContext"/>.</param> 37Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource);
PolicyAuthorizationResult.cs (1)
7/// The result of <see cref="IPolicyEvaluator.AuthorizeAsync(AuthorizationPolicy, Authentication.AuthenticateResult, Http.HttpContext, object?)"/>.
PolicyEvaluator.cs (7)
29/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 32/// <param name="context">The <see cref="HttpContext"/>.</param> 34public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 73static AuthenticateResult DefaultAuthenticateResult(HttpContext context) 85/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 86/// <param name="context">The <see cref="HttpContext"/>.</param> 94public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
Microsoft.AspNetCore.Components.Endpoints (89)
Assets\ImportMap.cs (1)
22[CascadingParameter] public HttpContext? HttpContext { get; set; } = null;
BrowserConfiguration\BrowserConfigurationHttpContextExtensions.cs (3)
9/// Extension methods on <see cref="HttpContext"/> for accessing <see cref="BrowserConfiguration"/>. 19/// <param name="context">The <see cref="HttpContext"/>.</param> 21public static BrowserConfiguration GetBrowserConfiguration(this HttpContext context)
BrowserConfiguration\ConfigureBrowser.cs (1)
28public HttpContext? HttpContext { get; set; }
Builder\OpaqueRedirection.cs (3)
42public static string CreateProtectedRedirectionUrl(HttpContext httpContext, string destinationUrl) 66private static Task OpaqueRedirect(HttpContext httpContext) 96private static ITimeLimitedDataProtector CreateProtector(HttpContext httpContext)
Builder\RazorComponentsEndpointHttpContextExtensions.cs (3)
16/// Extensions to <see cref="HttpContext"/> for Razor component applications. 27/// <param name="context">The <see cref="HttpContext"/>.</param> 29public static bool AcceptsInteractiveRouting(this HttpContext context)
Builder\ResourceCollectionUrlEndpoint.cs (9)
221public async Task FingerprintedGzipContent(HttpContext context) 229public async Task FingerprintedContent(HttpContext context) 236public async Task Content(HttpContext context) 243public async Task GzipContent(HttpContext context) 251private void WriteEncodingHeaders(HttpContext context) 257private void WriteNoEncodingHeaders(HttpContext context) 262private static void WriteFingerprintHeaders(HttpContext context) 267private static void WriteNonFingerprintedHeaders(HttpContext context) 272private static void WriteCommonHeaders(HttpContext context, byte[] contents)
DependencyInjection\IComponentPrerenderer.cs (5)
19/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 25HttpContext httpContext, 33/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 37HttpContext httpContext, 41/// Gets a <see cref="Dispatcher"/> that should be used for calls to <see cref="PrerenderComponentAsync(HttpContext, Type, IComponentRenderMode, ParameterView)"/>.
DependencyInjection\ITempDataProvider.cs (4)
14/// Loads temporary data from the given <see cref="HttpContext"/>. 16IDictionary<string, object?> LoadTempData(HttpContext context); 19/// Saves temporary data to the given <see cref="HttpContext"/>. 21void SaveTempData(HttpContext context, IDictionary<string, object?> values);
DependencyInjection\TempDataService.cs (3)
18public TempData CreateEmpty(HttpContext httpContext) 23public IDictionary<string, object?> Load(HttpContext httpContext) 28public void Save(HttpContext httpContext, TempData tempData)
Forms\EndpointAntiforgeryStateProvider.cs (2)
12private HttpContext? _context; 15internal void SetRequestContext(HttpContext context)
IRazorComponentEndpointInvoker.cs (2)
24/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 27Task Render(HttpContext context);
RazorComponentEndpointInvoker.cs (5)
36public Task Render(HttpContext context) 43private async Task RenderComponentCore(HttpContext context) 61var endpoint = context.GetEndpoint() ?? throw new InvalidOperationException($"An endpoint must be set on the '{nameof(HttpContext)}'."); 200private async Task<RequestValidationState> ValidateRequestAsync(HttpContext context, IAntiforgery? antiforgery) 282private static string? GetFormHandler(HttpContext context, out bool isBadRequest)
Rendering\EndpointHtmlRenderer.cs (6)
44private HttpContext _httpContext = default!; // Always set at the start of an inbound call 65internal HttpContext? HttpContext => _httpContext; 68internal void SetHttpContext(HttpContext httpContext) 81HttpContext httpContext, 153private static void InitializeResourceCollection(HttpContext httpContext) 177private static ResourceAssetCollection? GetResourceCollection(HttpContext httpContext) => httpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Rendering\EndpointHtmlRenderer.Prerendering.cs (7)
82public static void MarkAsAllowingEnhancedNavigation(HttpContext context) 88HttpContext httpContext, 97HttpContext httpContext, 140HttpContext httpContext, 223public static ValueTask<PrerenderedComponentHtmlContent> HandleNavigationException(HttpContext httpContext, NavigationException navigationException) 244private static ValueTask<PrerenderedComponentHtmlContent> HandleNavigationBeforeResponseStarted(HttpContext httpContext, string destinationLocation) 275internal static ServerComponentInvocationSequence GetOrCreateInvocationId(HttpContext httpContext)
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (4)
19public async ValueTask<IHtmlContent> PrerenderPersistedStateAsync(HttpContext httpContext) 111public async ValueTask<IHtmlContent> PrerenderPersistedStateAsync(HttpContext httpContext, PersistedStateSerializationMode serializationMode) 158internal static void UpdateSaveStateRenderMode(HttpContext httpContext, IComponentRenderMode? mode) 194internal static InvokedRenderModes.Mode GetPersistStateRenderMode(HttpContext httpContext)
Rendering\EndpointHtmlRenderer.Streaming.cs (8)
28public void InitializeStreamingRenderingFraming(HttpContext httpContext, bool isErrorHandler, bool isReExecuted) 46public async Task SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer) 97internal void EmitInitializersIfNecessary(HttpContext httpContext, TextWriter writer) 207internal static bool ShouldShowDetailedErrors(HttpContext httpContext) 215private static void HandleExceptionAfterResponseStarted(HttpContext httpContext, TextWriter writer, Exception exception) 229private static void HandleNotFoundAfterResponseStarted(TextWriter writer, HttpContext httpContext, string notFoundUrl) 235private static void HandleNavigationAfterResponseStarted(TextWriter writer, HttpContext httpContext, string destinationUrl) 242private static void WriteResponseTemplate(TextWriter writer, HttpContext httpContext, string destinationUrl, bool useEnhancedNav)
Rendering\SSRRenderModeBoundary.cs (4)
34private readonly HttpContext _httpContext; 40HttpContext httpContext, 58private static void AssertRenderModeIsConfigured(HttpContext httpContext, Type componentType, IComponentRenderMode renderMode) 197public ComponentMarker ToMarker(HttpContext httpContext, int sequence, object? componentKey)
Results\RazorComponentResult.cs (2)
97/// <param name="httpContext">An <see cref="HttpContext" /> associated with the current request.</param > 99public Task ExecuteAsync(HttpContext httpContext)
Results\RazorComponentResultExecutor.cs (2)
22public static Task ExecuteAsync(HttpContext httpContext, RazorComponentResult result) 42HttpContext httpContext,
SessionCascadingValueSupplier.cs (2)
20private HttpContext? _httpContext; 30internal void SetRequestContext(HttpContext httpContext)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (4)
90public string? GetRequestCookie(HttpContext context, string key) 145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
TempData\CookieTempDataProvider.cs (3)
41public IDictionary<string, object?> LoadTempData(HttpContext context) 110public void SaveTempData(HttpContext context, IDictionary<string, object?> values) 139private void SetCookiePath(HttpContext httpContext, CookieOptions cookieOptions)
TempData\SessionStorageTempDataProvider.cs (2)
24public IDictionary<string, object?> LoadTempData(HttpContext context) 55public void SaveTempData(HttpContext context, IDictionary<string, object?> values)
TempData\TempDataCascadingValueSupplier.cs (2)
17private HttpContext? _httpContext; 26internal void SetRequestContext(HttpContext httpContext)
TempData\TempDataProviderServiceCollectionExtensions.cs (2)
42var httpContext = sp.GetRequiredService<EndpointHtmlRenderer>().HttpContext; 50internal static ITempData GetOrCreateTempData(HttpContext httpContext)
Microsoft.AspNetCore.Components.Server (6)
Builder\ServerComponentsEndpointOptions.cs (1)
56public Func<HttpContext, WebSocketAcceptContext, Task>? ConfigureWebSocketAcceptContext { get; set; }
CircuitDisconnectMiddleware.cs (2)
32public async Task Invoke(HttpContext context) 52private async Task<CircuitId?> GetCircuitIdAsync(HttpContext context)
CircuitJavaScriptInitializationMiddleware.cs (1)
21public async Task InvokeAsync(HttpContext context)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (2)
166HttpContext httpContext, 167Func<HttpContext, WebSocketAcceptContext, Task>? configureConnection,
Microsoft.AspNetCore.CookiePolicy (13)
AppendCookieContext.cs (4)
17/// <param name="context">The request <see cref="HttpContext"/>.</param> 21public AppendCookieContext(HttpContext context, CookieOptions options, string name, string value) 30/// Gets the <see cref="HttpContext"/>. 32public HttpContext Context { get; }
CookiePolicyMiddleware.cs (2)
62/// <param name="context">The <see cref="HttpContext" />.</param> 63public Task Invoke(HttpContext context)
CookiePolicyOptions.cs (1)
70public Func<HttpContext, bool>? CheckConsentNeeded { get; set; }
DeleteCookieContext.cs (4)
17/// <param name="context">The request <see cref="HttpContext"/>.</param> 20public DeleteCookieContext(HttpContext context, CookieOptions options, string name) 28/// Gets the <see cref="HttpContext"/>. 30public HttpContext Context { get; }
ResponseCookiesWrapper.cs (2)
19public ResponseCookiesWrapper(HttpContext context, CookiePolicyOptions options, IResponseCookiesFeature feature, ILogger logger) 27private HttpContext Context { get; }
Microsoft.AspNetCore.Cors (16)
Infrastructure\CorsMiddleware.cs (4)
89public Task Invoke(HttpContext context, ICorsPolicyProvider corsPolicyProvider) 161async Task InvokeCoreAwaited(HttpContext context, Task<CorsPolicy?> policyTask) 168private Task EvaluateAndApplyPolicy(HttpContext context, CorsPolicy? corsPolicy) 195var (middleware, context, result) = (Tuple<CorsMiddleware, HttpContext, CorsResult>)state;
Infrastructure\CorsService.cs (5)
44public CorsResult EvaluatePolicy(HttpContext context, string policyName) 58public CorsResult EvaluatePolicy(HttpContext context, CorsPolicy policy) 97private static void PopulateResult(HttpContext context, CorsPolicy policy, CorsResult result) 135public virtual void EvaluateRequest(HttpContext context, CorsPolicy policy, CorsResult result) 146public virtual void EvaluatePreflightRequest(HttpContext context, CorsPolicy policy, CorsResult result)
Infrastructure\DefaultCorsPolicyProvider.cs (1)
25public Task<CorsPolicy?> GetPolicyAsync(HttpContext context, string? policyName)
Infrastructure\ICorsPolicyProvider.cs (3)
9/// A type which can provide a <see cref="CorsPolicy"/> for a particular <see cref="HttpContext"/>. 16/// <param name="context">The <see cref="HttpContext"/> associated with this call.</param> 19Task<CorsPolicy?> GetPolicyAsync(HttpContext context, string? policyName);
Infrastructure\ICorsService.cs (3)
9/// A type which can evaluate a policy for a particular <see cref="HttpContext"/>. 16/// <param name="context">The <see cref="HttpContext"/> associated with the call.</param> 20CorsResult EvaluatePolicy(HttpContext context, CorsPolicy policy);
Microsoft.AspNetCore.Diagnostics (34)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
53public Task Invoke(HttpContext context)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (7)
86var httpContext = errorContext.HttpContext; 106public async Task Invoke(HttpContext context) 204var httpContext = errorContext.HttpContext; 224var httpContext = errorContext.HttpContext; 249private ProblemDetails CreateProblemDetails(ErrorContext errorContext, HttpContext httpContext) 273HttpContext context, 334private Task DisplayRuntimeException(HttpContext context, Exception ex)
DiagnosticsTelemetry.cs (1)
12public static void ReportUnhandledException(ILogger logger, HttpContext context, Exception ex)
ExceptionHandler\ExceptionHandlerMiddleware.cs (2)
46/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 47public Task Invoke(HttpContext context)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (5)
70/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 71public Task Invoke(HttpContext context) 93static async Task Awaited(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) 113private async Task HandleException(HttpContext context, ExceptionDispatchInfo edi) 291private static void ClearHttpContext(HttpContext context)
ExceptionHandler\ExceptionHandlerOptions.cs (1)
24/// replace it on <see cref="HttpContext.RequestServices"/> when re-executing the request to handle an error.
ExceptionHandler\ExceptionHandlerSuppressDiagnosticsContext.cs (2)
14/// Gets the <see cref="Http.HttpContext"/> of the current request. 16public required HttpContext HttpContext { get; init; }
ExceptionHandler\IExceptionHandler.cs (2)
18/// <param name="httpContext">The <see cref="HttpContext"/> for the request.</param> 26ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken);
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (2)
25protected HttpContext Context { get; private set; } = default!; 61public async Task ExecuteAsync(HttpContext context)
src\aspnetcore\src\Shared\HttpExtensions.cs (2)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 49internal static void ClearEndpoint(HttpContext context)
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (2)
28protected HttpContext Context { get; private set; } = default!; 80public async Task ExecuteAsync(HttpContext context)
StatusCodePage\StatusCodeContext.cs (2)
20public StatusCodeContext(HttpContext context, StatusCodePagesOptions options, RequestDelegate next) 30public HttpContext HttpContext { get; private set; }
StatusCodePage\StatusCodePagesMiddleware.cs (2)
37/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 39public async Task Invoke(HttpContext context)
StatusCodePage\StatusCodePagesOptions.cs (1)
66/// replace it on <see cref="HttpContext.RequestServices"/> when re-executing the request.
WelcomePage\WelcomePageMiddleware.cs (2)
36/// <param name="context">The <see cref="HttpContext"/>.</param> 38public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.Abstractions (2)
ErrorContext.cs (2)
18public ErrorContext(HttpContext httpContext, Exception exception) 27public HttpContext HttpContext { get; }
Microsoft.AspNetCore.Diagnostics.HealthChecks (4)
Builder\HealthCheckApplicationBuilderExtensions.cs (1)
210Func<HttpContext, bool> predicate = c =>
HealthCheckMiddleware.cs (1)
41public async Task InvokeAsync(HttpContext httpContext)
HealthCheckOptions.cs (1)
71public Func<HttpContext, HealthReport, Task> ResponseWriter { get; set; } = HealthCheckResponseWriters.WriteMinimalPlaintext;
HealthCheckResponseWriters.cs (1)
16public static Task WriteMinimalPlaintext(HttpContext httpContext, HealthReport result)
Microsoft.AspNetCore.Diagnostics.Middleware (17)
Buffering\PerRequestLogBufferManager.cs (1)
41HttpContext? httpContext = _httpContextAccessor.HttpContext;
Latency\AddServerTimingHeaderMiddleware.cs (4)
29/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 31public Task InvokeAsync(HttpContext context) 35var httpContext = (HttpContext)ctx;
Latency\CapturePipelineEntryMiddleware.cs (1)
26public async Task InvokeAsync(HttpContext context)
Latency\CapturePipelineExitMiddleware.cs (1)
29public async Task InvokeAsync(HttpContext context)
Latency\CaptureResponseTimeMiddleware.cs (2)
32/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 34public Task InvokeAsync(HttpContext context)
Latency\RequestLatencyTelemetryMiddleware.cs (4)
55/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 57public Task InvokeAsync(HttpContext context) 65var httpContext = (HttpContext)ctx;
Logging\HttpLoggingRedactionInterceptor.cs (2)
68var context = logContext.HttpContext; 143var context = logContext.HttpContext;
Logging\IHttpLogEnricher.cs (2)
23/// <param name="httpContext"><see cref="HttpContext"/> object associated with the incoming HTTP request.</param> 24void Enrich(IEnrichmentTagCollector collector, HttpContext httpContext);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (28)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (7)
37var httpContextMock = GetHttpContext(lc.Object); 67var httpContextMock = GetHttpContext(lc.Object); 95var httpContextMock = GetHttpContext(lc.Object); 126var httpContextMock = GetHttpContext(lc.Object); 143var httpContextMock = GetHttpContext(lc.Object); 177var httpContextMock = GetHttpContext(lc.Object); 214private static HttpContext GetHttpContext(ILatencyContext latencyContext)
Logging\AcceptanceTests.cs (1)
993public void Enrich(IEnrichmentTagCollector collector, HttpContext httpContext) => throw new InvalidOperationException();
Logging\CustomHttpLogEnricher.cs (1)
19public void Enrich(IEnrichmentTagCollector collector, HttpContext httpContext)
Logging\HttpUtilityExtensionsTests.cs (3)
48HttpContext context = new DefaultHttpContext(); 59HttpContext context = new DefaultHttpContext(); 77HttpContext context = new DefaultHttpContext();
Logging\IncomingHttpRouteUtilityTests.cs (11)
52HttpContext context = new DefaultHttpContext(); 90HttpContext context = new DefaultHttpContext(); 130HttpContext context = new DefaultHttpContext(); 172HttpContext context = new DefaultHttpContext(); 214HttpContext context = new DefaultHttpContext(); 261HttpContext context = new DefaultHttpContext(); 302HttpContext context = new DefaultHttpContext(); 350HttpContext context = new DefaultHttpContext(); 395HttpContext context = new DefaultHttpContext(); 433HttpContext context = new DefaultHttpContext(); 456HttpContext context = new DefaultHttpContext();
Logging\RequestHeadersEnricherTests.cs (4)
46var httpContextMock = new Mock<HttpContext>(MockBehavior.Strict); 204accessorMock.SetupGet(r => r.HttpContext).Returns((HttpContext)null!); 232var httpContextMock = new Mock<HttpContext>(MockBehavior.Strict); 255var httpContextMock = new Mock<HttpContext>(MockBehavior.Strict);
Logging\TestHttpLogEnricher.cs (1)
19public void Enrich(IEnrichmentTagCollector collector, HttpContext httpContext)
Microsoft.AspNetCore.HeaderParsing (2)
HeaderParsingFeature.cs (1)
26internal HttpContext? Context { get; set; }
HeaderParsingHttpRequestExtensions.cs (1)
23var context = Throw.IfNull(request).HttpContext;
Microsoft.AspNetCore.HeaderParsing.Tests (6)
HeaderParsingExtensionsTests.cs (5)
87var context = CreateContext(new ServiceCollection().AddSingleton(headerRegistry.Object)); 94var context = CreateContext(new ServiceCollection().AddHeaderParsing()); 108var context = CreateContext(new ServiceCollection().AddHeaderParsing()); 121private static HttpContext CreateContext(IServiceCollection? services = null) 132private static HeaderKey<T> RegisterHeader<T>(HttpContext context, HeaderSetup<T> setup)
HeaderParsingFeatureTests.cs (1)
29private HttpContext Context => field ??= new DefaultHttpContext { RequestServices = _services.BuildServiceProvider() };
Microsoft.AspNetCore.HostFiltering (4)
HostFilteringMiddleware.cs (4)
53public Task Invoke(HttpContext context) 66private static Task HostValidationFailed(HttpContext context, MiddlewareConfiguration middlewareConfiguration) 82private bool CheckHost(HttpContext context, MiddlewareConfiguration middlewareConfiguration) 115private bool IsEmptyHostAllowed(HttpContext context, MiddlewareConfiguration middlewareConfiguration)
Microsoft.AspNetCore.Hosting (48)
Http\DefaultHttpContextFactory.cs (7)
15/// A factory for creating <see cref="HttpContext" /> instances. 26/// Creates a factory for creating <see cref="HttpContext" /> instances. 40/// Create an <see cref="HttpContext"/> instance given an <paramref name="featureCollection" />. 43/// <returns>An initialized <see cref="HttpContext"/> object.</returns> 44public HttpContext Create(IFeatureCollection featureCollection) 68/// Clears the current <see cref="HttpContext" />. 70public void Dispose(HttpContext httpContext)
Internal\HostingApplication.cs (3)
68HttpContext httpContext; 102var httpContext = context.HttpContext!; 130public HttpContext? HttpContext { get; set; }
Internal\HostingApplicationDiagnostics.cs (31)
71public void BeginRequest(HttpContext httpContext, HostingApplication.Context context) 155public void RequestEnd(HttpContext httpContext, Exception? exception, HostingApplication.Context context) 322private void RecordBeginRequestDiagnostics(HttpContext httpContext, long startTimestamp) 331private void RecordEndRequestDiagnostics(HttpContext httpContext, long currentTimestamp) 340private void RecordUnhandledExceptionDiagnostics(HttpContext httpContext, long currentTimestamp, Exception exception) 351[DynamicDependency(nameof(HttpContext.Request), typeof(HttpContext))] 352[DynamicDependency(nameof(HttpContext.Response), typeof(HttpContext))] 356internal DeprecatedRequestData(HttpContext httpContext, long timestamp) 363public HttpContext httpContext { get; } 372[DynamicDependency(nameof(HttpContext.Request), typeof(HttpContext))] 373[DynamicDependency(nameof(HttpContext.Response), typeof(HttpContext))] 377internal UnhandledExceptionData(HttpContext httpContext, long timestamp, Exception exception) 385public HttpContext httpContext { get; } 393private void RecordRequestStartEventLog(HttpContext httpContext) 399private void RecordRequestStartMetrics(HttpContext httpContext) 405private Activity? StartActivity(HttpContext httpContext, bool diagnosticsOrLoggingEnabled, out bool hasDiagnosticListener) 460private static TagList CreateInitializeActivityTags(HttpContext httpContext) 504private void StopActivity(HttpContext httpContext, Activity activity, Exception? exception, bool hasDiagnosticListener) 521private static void SetActivityEndTags(HttpContext httpContext, Activity activity, Exception? exception) 556[DynamicDependency(nameof(HttpContext.Request), typeof(HttpContext))] 569private Activity StartActivity(Activity activity, HttpContext httpContext) 578[DynamicDependency(nameof(HttpContext.Response), typeof(HttpContext))] 583private void StopActivity(Activity activity, HttpContext httpContext) 597public static IDisposable? RequestScope(ILogger logger, HttpContext httpContext) 628public HostingLogScope(HttpContext httpContext)
Internal\HostingRequestStartingLog.cs (1)
38public HostingRequestStartingLog(HttpContext httpContext)
Internal\HostingRequestUnhandledLog.cs (2)
15private readonly HttpContext _httpContext; 33public HostingRequestUnhandledLog(HttpContext httpContext)
src\aspnetcore\src\Shared\HttpExtensions.cs (2)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 49internal static void ClearEndpoint(HttpContext context)
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (2)
28protected HttpContext Context { get; private set; } = default!; 80public async Task ExecuteAsync(HttpContext context)
Microsoft.AspNetCore.Http (18)
DefaultHttpContext.cs (1)
224public HttpContext HttpContext => this;
Features\DefaultSessionFeature.cs (1)
8/// <see cref="HttpContext.Session"/> property without the need for creating a <see cref="ISessionFeature"/>.
Features\FormFeature.cs (1)
208using (cancellationToken.Register((state) => ((HttpContext)state!).Abort(), _request.HttpContext))
Features\RequestBodyPipeFeature.cs (2)
15private readonly HttpContext _context; 24public RequestBodyPipeFeature(HttpContext context)
Features\RequestServicesFeature.cs (3)
17private readonly HttpContext _context; 22/// <param name="context">The <see cref="HttpContext"/>.</param> 24public RequestServicesFeature(HttpContext context, IServiceScopeFactory? scopeFactory)
Features\RouteValuesFeature.cs (1)
9/// A feature for routing values. Use <see cref="HttpContext.Features"/>
HttpContextAccessor.cs (2)
17public HttpContext? HttpContext 39public HttpContext? Context;
Internal\DefaultHttpRequest.cs (2)
21private static readonly Func<HttpContext, IRequestBodyPipeFeature> _newRequestBodyPipeFeature = context => new RequestBodyPipeFeature(context); 47public override HttpContext HttpContext => _context;
Internal\DefaultHttpResponse.cs (1)
54public override HttpContext HttpContext { get { return _context; } }
src\aspnetcore\src\Shared\Debugger\HttpContextDebugFormatter.cs (1)
53public static string ContextToString(HttpContext context, string? reasonPhrase)
Timeouts\CancellationTokenLinker.cs (1)
12public (CancellationTokenSource linkedCts, CancellationTokenSource timeoutCts) GetLinkedCancellationTokenSource(HttpContext httpContext, CancellationToken originalToken, TimeSpan timeSpan)
Timeouts\ICancellationTokenLinker.cs (1)
8(CancellationTokenSource linkedCts, CancellationTokenSource timeoutCts) GetLinkedCancellationTokenSource(HttpContext httpContext, CancellationToken originalToken, TimeSpan timeSpan);
Timeouts\RequestTimeoutsMiddleware.cs (1)
29public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Http.Abstractions (91)
CookieBuilder.cs (6)
63/// This is determined from the <see cref="HttpContext"/> passed to <see cref="Build(HttpContext, DateTimeOffset)"/>. 95/// <param name="context">The <see cref="HttpContext"/>.</param> 97public CookieOptions Build(HttpContext context) => Build(context, DateTimeOffset.Now); 102/// <param name="context">The <see cref="HttpContext"/>.</param> 105public virtual CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom)
DefaultEndpointFilterInvocationContext.cs (2)
17public DefaultEndpointFilterInvocationContext(HttpContext httpContext, params object?[] arguments) 24public override HttpContext HttpContext { get; }
EndpointFilterInvocationContext.cs (10)
15public abstract HttpContext HttpContext { get; } 36public static EndpointFilterInvocationContext Create(HttpContext httpContext) => 43public static EndpointFilterInvocationContext Create<T>(HttpContext httpContext, T arg) => 50public static EndpointFilterInvocationContext Create<T1, T2>(HttpContext httpContext, T1 arg1, T2 arg2) => 57public static EndpointFilterInvocationContext Create<T1, T2, T3>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3) => 64public static EndpointFilterInvocationContext Create<T1, T2, T3, T4>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3, T4 arg4) => 71public static EndpointFilterInvocationContext Create<T1, T2, T3, T4, T5>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) => 78public static EndpointFilterInvocationContext Create<T1, T2, T3, T4, T5, T6>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) => 85public static EndpointFilterInvocationContext Create<T1, T2, T3, T4, T5, T6, T7>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) => 92public static EndpointFilterInvocationContext Create<T1, T2, T3, T4, T5, T6, T7, T8>(HttpContext httpContext, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) =>
EndpointFilterInvocationContextOfT.Generated.cs (20)
14internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0) 40public override HttpContext HttpContext { get; } 136internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1) 167public override HttpContext HttpContext { get; } 265internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2) 301public override HttpContext HttpContext { get; } 401internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3) 442public override HttpContext HttpContext { get; } 544internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) 590public override HttpContext HttpContext { get; } 694internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) 745public override HttpContext HttpContext { get; } 851internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) 907public override HttpContext HttpContext { get; } 1015internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) 1076public override HttpContext HttpContext { get; } 1186internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) 1252public override HttpContext HttpContext { get; } 1364internal EndpointFilterInvocationContext(HttpContext httpContext, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) 1435public override HttpContext HttpContext { get; }
Extensions\MapMiddleware.cs (3)
38/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 40public Task Invoke(HttpContext context) 55private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
Extensions\MapWhenExtensions.cs (1)
9using Predicate = Func<HttpContext, bool>;
Extensions\MapWhenMiddleware.cs (2)
43/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 45public Task Invoke(HttpContext context)
Extensions\MapWhenOptions.cs (2)
13private Func<HttpContext, bool>? _predicate; 18public Func<HttpContext, bool>? Predicate
Extensions\UseExtensions.cs (3)
17/// Prefer using <see cref="Use(IApplicationBuilder, Func{HttpContext, RequestDelegate, Task})"/> for better performance as shown below: 29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 48public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware)
Extensions\UseMiddlewareExtensions.cs (6)
93if (parameters.Length == 0 || parameters[0].ParameterType != typeof(HttpContext)) 95throw new InvalidOperationException(Resources.FormatException_UseMiddlewareNoParameters(InvokeMethodName, InvokeAsyncMethodName, nameof(HttpContext))); 200private static Func<T, HttpContext, IServiceProvider, Task> ReflectionFallback<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 265private static Func<T, HttpContext, IServiceProvider, Task> CompileExpression<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 297var httpContextArg = Expression.Parameter(typeof(HttpContext), "httpContext"); 323var lambda = Expression.Lambda<Func<T, HttpContext, IServiceProvider, Task>>(body, instanceArg, httpContextArg, providerArg);
Extensions\UsePathBaseMiddleware.cs (3)
37/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 39public Task Invoke(HttpContext context) 50private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
Extensions\UseWhenExtensions.cs (1)
8using Predicate = Func<HttpContext, bool>;
HttpContext.cs (2)
85private sealed class HttpContextDebugView(HttpContext context) 87private readonly HttpContext _context = context;
HttpRequest.cs (1)
22public abstract HttpContext HttpContext { get; }
HttpResponse.cs (1)
37public abstract HttpContext HttpContext { get; }
HttpResults\EmptyHttpResult.cs (1)
22public Task ExecuteAsync(HttpContext httpContext)
HttpResults\IResult.cs (2)
14/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 16Task ExecuteAsync(HttpContext httpContext);
IBindableFromHttpContextOfT.cs (4)
9/// Defines a mechanism for creating an instance of a type from an <see cref="HttpContext"/> when binding parameters for an endpoint 16/// Creates an instance of <typeparamref name="TSelf"/> from the <see cref="HttpContext"/>. 18/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 21static abstract ValueTask<TSelf?> BindAsync(HttpContext context, ParameterInfo parameter);
IHttpContextAccessor.cs (1)
18HttpContext? HttpContext { get; set; }
IHttpContextFactory.cs (7)
9/// Provides methods to create and dispose of <see cref="HttpContext"/> instances. 14/// Creates an <see cref="HttpContext"/> instance for the specified set of HTTP features. 17/// <returns>The <see cref="HttpContext"/> instance.</returns> 18HttpContext Create(IFeatureCollection featureCollection); 21/// Releases resources held by the <see cref="HttpContext"/>. 23/// <param name="httpContext">The <see cref="HttpContext"/> to dispose.</param> 24void Dispose(HttpContext httpContext);
IMiddleware.cs (2)
14/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 17Task InvokeAsync(HttpContext context, RequestDelegate next);
ProblemDetails\IProblemDetailsWriter.cs (1)
8/// payload to the current <see cref="HttpContext.Response"/>.
ProblemDetails\ProblemDetailsContext.cs (1)
18public required HttpContext HttpContext { get; init; }
RequestDelegate.cs (2)
9/// <param name="context">The <see cref="HttpContext"/> for the request.</param> 11public delegate Task RequestDelegate(HttpContext context);
Routing\EndpointHttpContextExtensions.cs (4)
16/// <param name="context">The <see cref="HttpContext"/> context.</param> 22public static Endpoint? GetEndpoint(this HttpContext context) 32/// <param name="context">The <see cref="HttpContext"/> context.</param> 34public static void SetEndpoint(this HttpContext context, Endpoint? endpoint)
Routing\IEndpointFeature.cs (1)
7/// A feature interface for endpoint routing. Use <see cref="HttpContext.Features"/>
Routing\IRouteValuesFeature.cs (1)
9/// A feature interface for routing values. Use <see cref="HttpContext.Features"/>
src\aspnetcore\src\Shared\Debugger\HttpContextDebugFormatter.cs (1)
53public static string ContextToString(HttpContext context, string? reasonPhrase)
Microsoft.AspNetCore.Http.Connections (32)
Features\IHttpContextFeature.cs (3)
9/// Feature set on the <see cref="ConnectionContext"/> that provides access to the underlying <see cref="Http.HttpContext"/> 15/// The <see cref="Http.HttpContext"/> associated with the connection if available. 21HttpContext? HttpContext { get; set; }
HttpConnectionContextExtensions.cs (4)
10/// Extension method to get the underlying <see cref="HttpContext"/> of the connection if there is one. 15/// Gets the <see cref="HttpContext"/> associated with the connection, if there is one. 18/// <returns>The <see cref="HttpContext"/> associated with the connection, or <see langword="null"/> if the connection is not HTTP-based.</returns> 23public static HttpContext? GetHttpContext(this ConnectionContext connection)
Internal\HttpConnectionContext.cs (5)
207public HttpContext? HttpContext { get; set; } 409HttpContext context, 441HttpContext nonClonedContext, 510private void FailActivationUnsynchronized(HttpContext nonClonedContext, ILogger dispatcherLogger) 532internal async Task<bool> CancelPreviousPoll(HttpContext context)
Internal\HttpConnectionDispatcher.cs (16)
62public async Task ExecuteAsync(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionDelegate connectionDelegate) 103public async Task ExecuteNegotiateAsync(HttpContext context, HttpConnectionDispatcherOptions options) 122private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connectionDelegate, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 337private async Task ProcessNegotiate(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 407private static void WriteNegotiatePayload(IBufferWriter<byte> writer, string? connectionId, string? connectionToken, HttpContext context, HttpConnectionDispatcherOptions options, 448private static StringValues GetConnectionToken(HttpContext context) => context.Request.Query["id"]; 450private async Task ProcessSend(HttpContext context) 543private async Task ProcessDeleteAsync(HttpContext context) 571private async Task<bool> EnsureConnectionStateAsync(HttpConnectionContext connection, HttpContext context, HttpTransportType transportType, HttpTransportType supportedTransports, ConnectionLogScope logScope) 619var existing = connection.HttpContext; 667private static void UpdateExpiration(HttpConnectionContext connection, HttpContext context) 678private static void CloneUser(HttpContext newContext, HttpContext oldContext) 714private static void CloneHttpContext(HttpContext context, HttpConnectionContext connection) 778private async Task<HttpConnectionContext?> GetConnectionAsync(HttpContext context) 805private async Task<HttpConnectionContext?> GetOrCreateConnectionAsync(HttpContext context, HttpConnectionDispatcherOptions options)
Internal\Transports\IHttpTransport.cs (1)
14Task<bool> ProcessRequestAsync(HttpContext context, CancellationToken token);
Internal\Transports\LongPollingServerTransport.cs (1)
32public async Task<bool> ProcessRequestAsync(HttpContext context, CancellationToken token)
Internal\Transports\ServerSentEventsServerTransport.cs (1)
31public async Task<bool> ProcessRequestAsync(HttpContext context, CancellationToken cancellationToken)
Internal\Transports\WebSocketsServerTransport.cs (1)
37public async Task<bool> ProcessRequestAsync(HttpContext context, CancellationToken token)
Microsoft.AspNetCore.Http.Extensions (82)
DefaultProblemDetailsWriter.cs (2)
28var httpContext = context.HttpContext; 55var httpContext = context.HttpContext;
HttpContextServerVariableExtensions.cs (1)
22public static string? GetServerVariable(this HttpContext context, string variableName)
HttpRequestJsonExtensions.cs (1)
397private static JsonSerializerOptions ResolveSerializerOptions(HttpContext httpContext)
HttpResponseJsonExtensions.cs (1)
342private static JsonSerializerOptions ResolveSerializerOptions(HttpContext httpContext)
RequestDelegateFactory.cs (70)
77private static readonly MethodInfo LogParameterBindingFailedMethod = GetMethodInfo<Action<HttpContext, string, string, string, bool>>((httpContext, parameterType, parameterName, sourceValue, shouldThrow) => 79private static readonly MethodInfo LogRequiredParameterNotProvidedMethod = GetMethodInfo<Action<HttpContext, string, string, string, bool>>((httpContext, parameterType, parameterName, source, shouldThrow) => 81private static readonly MethodInfo LogImplicitBodyNotProvidedMethod = GetMethodInfo<Action<HttpContext, string, bool>>((httpContext, parameterName, shouldThrow) => 83private static readonly MethodInfo LogFormMappingFailedMethod = GetMethodInfo<Action<HttpContext, string, string, FormDataMappingException, bool>>((httpContext, parameterName, parameterType, exception, shouldThrow) => 92private static readonly MemberExpression RequestServicesExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.RequestServices))!); 93private static readonly MemberExpression HttpRequestExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Request))!); 94private static readonly MemberExpression HttpResponseExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Response))!); 95private static readonly MemberExpression RequestAbortedExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.RequestAborted))!); 96private static readonly MemberExpression UserExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.User))!); 112private static readonly ConstructorInfo DefaultEndpointFilterInvocationContextConstructor = typeof(DefaultEndpointFilterInvocationContext).GetConstructor(new[] { typeof(HttpContext), typeof(object[]) })!; 118private static readonly MemberExpression FilterContextHttpContextResponseExpr = Expression.Property(FilterContextHttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Response))!); 189Expression<Func<HttpContext, object?>> targetFactory = (httpContext) => handler.Target; 210public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory, RequestDelegateFactoryOptions? options) 229public static RequestDelegateResult Create(MethodInfo methodInfo, Func<HttpContext, object>? targetFactory = null, RequestDelegateFactoryOptions? options = null, RequestDelegateMetadataResult? metadataResult = null) 314private static Func<object?, HttpContext, Task>? CreateTargetableRequestDelegate( 318Expression<Func<HttpContext, object?>>? targetFactory = null) 421private static EndpointFilterDelegate? CreateFilterPipeline(MethodInfo methodInfo, Expression? targetExpression, RequestDelegateFactoryContext factoryContext, Expression<Func<HttpContext, object?>>? targetFactory) 835else if (parameter.ParameterType == typeof(HttpContext)) 1263private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegate(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1270var continuation = Expression.Lambda<Func<object?, HttpContext, object?[], Task>>( 1290return Expression.Lambda<Func<object?, HttpContext, Task>>( 1304private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForJson(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1318var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1355var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 1379HttpContext httpContext, 1459private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForForm( 1475var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1509var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 1530HttpContext httpContext, 2062var bindAsyncDelegate = Expression.Lambda<Func<HttpContext, ValueTask<object?>>>(bindAsyncMethod.Expression, HttpContextExpr).Compile(); 2472private static Task ExecuteValueTaskOfObject(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2474static async Task ExecuteAwaited(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2487private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2489static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2502private static Task ExecuteAwaitedReturn(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2507private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2511static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2524private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2528static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2541private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext) 2546static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext) 2559private static Task ExecuteWriteStringResponseAsync(HttpContext httpContext, string text) 2614private static Task ExecuteValueTaskOfTFast<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2616static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2629private static Task ExecuteValueTaskOfT<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2631static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2644private static Task ExecuteValueTaskOfString(ValueTask<string?> task, HttpContext httpContext) 2648static async Task ExecuteAwaited(ValueTask<string> task, HttpContext httpContext) 2661private static Task ExecuteValueTaskResult<T>(ValueTask<T?> task, HttpContext httpContext) where T : IResult 2663static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext) 2676private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult 2683private static async Task ExecuteResultWriteResponse(IResult? result, HttpContext httpContext) 2727public static void RequestBodyIOException(HttpContext httpContext, IOException exception) 2733public static void InvalidJsonRequestBody(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2747public static void ParameterBindingFailed(HttpContext httpContext, string parameterTypeName, string parameterName, string sourceValue, bool shouldThrow) 2761public static void RequiredParameterNotProvided(HttpContext httpContext, string parameterTypeName, string parameterName, string source, bool shouldThrow) 2775public static void ImplicitBodyNotProvided(HttpContext httpContext, string parameterName, bool shouldThrow) 2789public static void UnexpectedJsonContentType(HttpContext httpContext, string? contentType, bool shouldThrow) 2803public static void UnexpectedNonFormContentType(HttpContext httpContext, string? contentType, bool shouldThrow) 2817public static void InvalidFormRequestBody(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2831public static void InvalidAntiforgeryToken(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2845public static void FormDataMappingFailed(HttpContext httpContext, string parameterTypeName, string parameterName, FormDataMappingException exception, bool shouldThrow) 2859public static void UnexpectedRequestWithoutBody(HttpContext httpContext, string parameterTypeName, string parameterName, bool shouldThrow) 2873private static ILogger GetLogger(HttpContext httpContext)
RequestDelegateFactoryContext.cs (1)
41public List<Func<HttpContext, ValueTask<object?>>> ParameterBinders { get; } = new();
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
39internal static readonly ParameterExpression HttpContextExpr = Expression.Parameter(typeof(HttpContext), "httpContext"); 226methodInfo = GetStaticMethodFromHierarchy(nonNullableParameterType, "BindAsync", new[] { typeof(HttpContext), typeof(ParameterInfo) }, ValidateReturnType); 231methodInfo = GetStaticMethodFromHierarchy(nonNullableParameterType, "BindAsync", new[] { typeof(HttpContext) }, ValidateReturnType); 424private static ValueTask<TValue?> BindAsync<TValue>(HttpContext httpContext, ParameterInfo parameter)
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 31public static void SetPlaintextContentType(HttpContext httpContext)
Microsoft.AspNetCore.Http.Results (72)
Accepted.cs (1)
59public Task ExecuteAsync(HttpContext httpContext)
AcceptedAtRoute.cs (1)
77public Task ExecuteAsync(HttpContext httpContext)
AcceptedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
AcceptedOfT.cs (1)
75public Task ExecuteAsync(HttpContext httpContext)
BadRequest.cs (1)
34public Task ExecuteAsync(HttpContext httpContext)
BadRequestOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ChallengeHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
Conflict.cs (1)
34public Task ExecuteAsync(HttpContext httpContext)
ConflictOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ContentHttpResult.cs (2)
56/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 58public Task ExecuteAsync(HttpContext httpContext)
Created.cs (1)
59public Task ExecuteAsync(HttpContext httpContext)
CreatedAtRoute.cs (1)
77public Task ExecuteAsync(HttpContext httpContext)
CreatedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
CreatedOfT.cs (1)
74public Task ExecuteAsync(HttpContext httpContext)
FileContentHttpResult.cs (1)
107public Task ExecuteAsync(HttpContext httpContext)
FileStreamHttpResult.cs (1)
113public async Task ExecuteAsync(HttpContext httpContext)
ForbidHttpResult.cs (1)
81public async Task ExecuteAsync(HttpContext httpContext)
HttpResultsHelper.cs (4)
27HttpContext httpContext, 70HttpContext httpContext, 98HttpContext httpContext, 156private static JsonOptions ResolveJsonOptions(HttpContext httpContext)
InternalServerError.cs (1)
34public Task ExecuteAsync(HttpContext httpContext)
InternalServerErrorOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
JsonHttpResultOfT.cs (1)
92public Task ExecuteAsync(HttpContext httpContext)
NoContent.cs (1)
33public Task ExecuteAsync(HttpContext httpContext)
NotFound.cs (1)
33public Task ExecuteAsync(HttpContext httpContext)
NotFoundOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
Ok.cs (1)
33public Task ExecuteAsync(HttpContext httpContext)
OkOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
PhysicalFileHttpResult.cs (2)
108public Task ExecuteAsync(HttpContext httpContext) 140private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, string fileName)
ProblemHttpResult.cs (1)
52public async Task ExecuteAsync(HttpContext httpContext)
PushStreamHttpResult.cs (1)
101public Task ExecuteAsync(HttpContext httpContext)
RedirectHttpResult.cs (1)
89public Task ExecuteAsync(HttpContext httpContext)
RedirectToRouteHttpResult.cs (1)
157public Task ExecuteAsync(HttpContext httpContext)
Results.cs (4)
28/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ChallengeAsync(HttpContext, string?, AuthenticationProperties?)" />. 45/// Creates a <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ForbidAsync(HttpContext, string?, AuthenticationProperties?)"/>. 63/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />. 76/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignOutAsync(HttpContext, string?, AuthenticationProperties?)" />.
ResultsOfT.Generated.cs (5)
40public Task ExecuteAsync(HttpContext httpContext) 104public Task ExecuteAsync(HttpContext httpContext) 177public Task ExecuteAsync(HttpContext httpContext) 259public Task ExecuteAsync(HttpContext httpContext) 350public Task ExecuteAsync(HttpContext httpContext)
ServerSentEventsResult.cs (1)
39public async Task ExecuteAsync(HttpContext httpContext)
SignInHttpResult.cs (1)
56public Task ExecuteAsync(HttpContext httpContext)
SignOutHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (4)
18/// Provides a parser for the Range Header in an <see cref="HttpContext.Request"/>. 23/// Returns the normalized form of the requested range if the Range Header in the <see cref="HttpContext.Request"/> is valid. 25/// <param name="context">The <see cref="HttpContext"/> associated with the request.</param> 35HttpContext context,
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (5)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength) 91HttpContext httpContext, 287HttpContext httpContext, 343private static void SetContentDispositionHeader(HttpContext httpContext, in FileResultInfo result)
src\aspnetcore\src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
14internal static string? Content(HttpContext httpContext, string? contentPath)
StatusCodeHttpResult.cs (2)
35/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 37public Task ExecuteAsync(HttpContext httpContext)
TypedResults.cs (4)
28/// Creates a <see cref="ChallengeHttpResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ChallengeAsync(HttpContext, string?, AuthenticationProperties?)" />. 45/// Creates a <see cref="ForbidHttpResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.ForbidAsync(HttpContext, string?, AuthenticationProperties?)"/>. 63/// Creates a <see cref="SignInHttpResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />. 80/// Creates a <see cref="SignOutHttpResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignOutAsync(HttpContext, string?, AuthenticationProperties?)" />.
UnauthorizedHttpResult.cs (1)
30public Task ExecuteAsync(HttpContext httpContext)
UnprocessableEntity.cs (1)
34public Task ExecuteAsync(HttpContext httpContext)
UnprocessableEntityOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
Utf8ContentHttpResult.cs (2)
47/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 49public Task ExecuteAsync(HttpContext httpContext)
ValidationProblem.cs (1)
52public async Task ExecuteAsync(HttpContext httpContext)
VirtualFileHttpResult.cs (2)
102public Task ExecuteAsync(HttpContext httpContext) 135private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, IFileInfo fileInfo)
Microsoft.AspNetCore.HttpLogging (5)
HttpLoggingInterceptorContext.cs (2)
23private HttpContext? _httpContext; 31public HttpContext HttpContext
HttpLoggingMiddleware.cs (2)
53public Task Invoke(HttpContext context) 74private async Task InvokeInternal(HttpContext context, HttpLoggingOptions options,
W3CLoggingMiddleware.cs (1)
70public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.HttpOverrides (10)
CertificateForwardingMiddleware.cs (2)
45/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 47public Task Invoke(HttpContext httpContext)
ForwardedHeadersMiddleware.cs (5)
109/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 110public Task Invoke(HttpContext context) 117/// Forward the proxied headers to the given <see cref="HttpContext"/>. 119/// <param name="context">The <see cref="HttpContext"/>.</param> 120public void ApplyForwarders(HttpContext context)
HttpMethodOverrideMiddleware.cs (3)
35/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 36public Task Invoke(HttpContext context) 59private async Task InvokeCore(HttpContext context)
Microsoft.AspNetCore.HttpsPolicy (3)
HstsMiddleware.cs (2)
60/// <param name="context">The <see cref="HttpContext"/>.</param> 62public Task Invoke(HttpContext context)
HttpsRedirectionMiddleware.cs (1)
78public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Identity (67)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (41)
87var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.RegisterRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!); 105var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.RegisterRequest>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!); 113async Task RequestHandler(HttpContext httpContext) 123var context_local = httpContext; 141async Task RequestHandlerFiltered(HttpContext httpContext) 151var context_local = httpContext; 159var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Identity.Data.RegisterRequest, global::Microsoft.AspNetCore.Http.HttpContext, global::System.IServiceProvider>(httpContext, registration_local!, context_local, sp_local)); 170var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem>> (global::Microsoft.AspNetCore.Identity.Data.RegisterRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!); 233async Task RequestHandler(HttpContext httpContext) 294async Task RequestHandlerFiltered(HttpContext httpContext) 417async Task RequestHandler(HttpContext httpContext) 444async Task RequestHandlerFiltered(HttpContext httpContext) 533async Task RequestHandler(HttpContext httpContext) 575async Task RequestHandlerFiltered(HttpContext httpContext) 654var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Ok> (global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!); 672var task = handler(ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!); 680async Task RequestHandler(HttpContext httpContext) 690var context_local = httpContext; 708async Task RequestHandlerFiltered(HttpContext httpContext) 718var context_local = httpContext; 726var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest, global::Microsoft.AspNetCore.Http.HttpContext, global::System.IServiceProvider>(httpContext, resendRequest_local!, context_local, sp_local)); 737var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Ok> (global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest arg0, global::Microsoft.AspNetCore.Http.HttpContext arg1, global::System.IServiceProvider arg2) => throw null!); 798async Task RequestHandler(HttpContext httpContext) 825async Task RequestHandlerFiltered(HttpContext httpContext) 914async Task RequestHandler(HttpContext httpContext) 941async Task RequestHandlerFiltered(HttpContext httpContext) 1031async Task RequestHandler(HttpContext httpContext) 1059async Task RequestHandlerFiltered(HttpContext httpContext) 1147async Task RequestHandler(HttpContext httpContext) 1168async Task RequestHandlerFiltered(HttpContext httpContext) 1227var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!); 1245var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.InfoRequest>(1)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!); 1253async Task RequestHandler(HttpContext httpContext) 1264var context_local = httpContext; 1282async Task RequestHandlerFiltered(HttpContext httpContext) 1293var context_local = httpContext; 1301var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::Microsoft.AspNetCore.Identity.Data.InfoRequest, global::Microsoft.AspNetCore.Http.HttpContext, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, infoRequest_local!, context_local, sp_local)); 1312var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!); 1359private static Task ExecuteReturnAsync(object? obj, HttpContext httpContext, JsonTypeInfo<object?> jsonTypeInfo) 1396private static async ValueTask<(bool, T?)> TryResolveBodyAsync<T>(HttpContext httpContext, LogOrThrowExceptionHelper logOrThrowExceptionHelper, bool allowEmpty, string parameterTypeName, string parameterName, JsonTypeInfo<T> jsonTypeInfo, bool isInferred = false) 1475private static Task ExecuteAsyncExplicit(IResult result, HttpContext httpContext)
AspNetRoleManager.cs (1)
25/// <param name="contextAccessor">The accessor used to access the <see cref="HttpContext"/>.</param>
IdentityApiEndpointRouteBuilderExtensions.cs (4)
58([FromBody] RegisterRequest registration, HttpContext context, [FromServices] IServiceProvider sp) => 194([FromBody] ResendConfirmationEmailRequest resendRequest, HttpContext context, [FromServices] IServiceProvider sp) => 349(ClaimsPrincipal claimsPrincipal, [FromBody] InfoRequest infoRequest, HttpContext context, [FromServices] IServiceProvider sp) => 390async Task SendConfirmationEmailAsync(TUser user, UserManager<TUser> userManager, HttpContext context, string email, bool isChange = false)
IPasskeyHandler.cs (2)
21Task<PasskeyCreationOptionsResult> MakeCreationOptionsAsync(PasskeyUserEntity userEntity, HttpContext httpContext); 29Task<PasskeyRequestOptionsResult> MakeRequestOptionsAsync(TUser? user, HttpContext httpContext);
PasskeyAssertionContext.cs (3)
14/// Gets or sets the <see cref="Http.HttpContext"/> for the current request. 16public required HttpContext HttpContext { get; init; } 29/// previously returned from <see cref="IPasskeyHandler{TUser}.MakeRequestOptionsAsync(TUser, HttpContext)"/>.
PasskeyAttestationContext.cs (3)
14/// Gets or sets the <see cref="Http.HttpContext"/> for the current request. 16public required HttpContext HttpContext { get; init; } 29/// previously returned from <see cref="IPasskeyHandler{TUser}.MakeCreationOptionsAsync(PasskeyUserEntity, HttpContext)"/>.
PasskeyAttestationStatementVerificationContext.cs (1)
19public required HttpContext HttpContext { get; init; }
PasskeyHandler.cs (6)
38public async Task<PasskeyCreationOptionsResult> MakeCreationOptionsAsync(PasskeyUserEntity userEntity, HttpContext httpContext) 110public async Task<PasskeyRequestOptionsResult> MakeRequestOptionsAsync(TUser? user, HttpContext httpContext) 571HttpContext httpContext) 622HttpContext httpContext) 654private ValueTask<bool> ValidateOriginAsync(CollectedClientData clientData, HttpContext httpContext) 680private string GetServerDomain(HttpContext httpContext)
PasskeyOriginValidationContext.cs (1)
16public required HttpContext HttpContext { get; init; }
SignInManager.cs (5)
37private HttpContext? _context; 45/// <param name="contextAccessor">The accessor used to access the <see cref="HttpContext"/>.</param> 104/// The <see cref="HttpContext"/> used. 106public HttpContext Context 110var context = _context ?? _contextAccessor?.HttpContext;
Microsoft.AspNetCore.Localization (11)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
23public override Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext)
CookieRequestCultureProvider.cs (1)
29public override Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext)
CustomRequestCultureProvider.cs (3)
13private readonly Func<HttpContext, Task<ProviderCultureResult?>> _provider; 19public CustomRequestCultureProvider(Func<HttpContext, Task<ProviderCultureResult?>> provider) 27public override Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext)
IRequestCultureProvider.cs (2)
16/// <param name="httpContext">The <see cref="HttpContext"/> for the request.</param> 21Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext);
QueryStringRequestCultureProvider.cs (1)
27public override Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext)
RequestCultureProvider.cs (1)
26public abstract Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext);
RequestLocalizationMiddleware.cs (2)
45/// <param name="context">The <see cref="HttpContext"/>.</param> 47public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.Localization.Routing (1)
RouteDataRequestCultureProvider.cs (1)
28public override Task<ProviderCultureResult?> DetermineProviderCultureResult(HttpContext httpContext)
Microsoft.AspNetCore.Mvc.Abstractions (26)
ActionConstraints\ActionConstraintProviderContext.cs (4)
17/// <param name="context">The <see cref="Http.HttpContext"/> associated with the request.</param> 21HttpContext context, 35/// The <see cref="Http.HttpContext"/> associated with the request. 37public HttpContext HttpContext { get; }
ActionContext.cs (6)
43/// <param name="httpContext">The <see cref="Http.HttpContext"/> for the current request.</param> 47HttpContext httpContext, 57/// <param name="httpContext">The <see cref="Http.HttpContext"/> for the current request.</param> 62HttpContext httpContext, 87/// Gets or sets the <see cref="Http.HttpContext"/> for the current request. 92public HttpContext HttpContext { get; set; } = default!;
Formatters\InputFormatterContext.cs (6)
19/// The <see cref="Http.HttpContext"/> for the current operation. 32HttpContext httpContext, 45/// The <see cref="Http.HttpContext"/> for the current operation. 61HttpContext httpContext, 93/// Gets the <see cref="Http.HttpContext"/> associated with the current operation. 95public HttpContext HttpContext { get; }
Formatters\OutputFormatterCanWriteContext.cs (2)
18protected OutputFormatterCanWriteContext(HttpContext httpContext) 28public virtual HttpContext HttpContext { get; protected set; }
Formatters\OutputFormatterWriteContext.cs (2)
17/// <param name="httpContext">The <see cref="Http.HttpContext"/> for the current request.</param> 21public OutputFormatterWriteContext(HttpContext httpContext, Func<Stream, Encoding, TextWriter> writerFactory, Type? objectType, object? @object)
ModelBinding\ModelBindingContext.cs (2)
39/// Gets the <see cref="Http.HttpContext"/> associated with this context. 41public virtual HttpContext HttpContext => ActionContext?.HttpContext!;
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
39internal static readonly ParameterExpression HttpContextExpr = Expression.Parameter(typeof(HttpContext), "httpContext"); 226methodInfo = GetStaticMethodFromHierarchy(nonNullableParameterType, "BindAsync", new[] { typeof(HttpContext), typeof(ParameterInfo) }, ValidateReturnType); 231methodInfo = GetStaticMethodFromHierarchy(nonNullableParameterType, "BindAsync", new[] { typeof(HttpContext) }, ValidateReturnType); 424private static ValueTask<TValue?> BindAsync<TValue>(HttpContext httpContext, ParameterInfo parameter)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
279parameterType == typeof(HttpContext) ||
Microsoft.AspNetCore.Mvc.Core (96)
ActionConstraints\ActionConstraintCache.cs (3)
45public IReadOnlyList<IActionConstraint>? GetActionConstraints(HttpContext httpContext, ActionDescriptor action) 93private IReadOnlyList<IActionConstraint>? GetActionConstraintsFromEntry(CacheEntry entry, HttpContext httpContext, ActionDescriptor action) 121private void ExecuteProviders(HttpContext httpContext, ActionDescriptor action, List<ActionConstraintItem> items)
CacheProfile.cs (4)
15/// <see cref="Microsoft.AspNetCore.Http.HttpContext.Response" />. 22/// the "Cache-control" header is set in the <see cref="Microsoft.AspNetCore.Http.HttpContext.Response" />. 29/// <see cref="Microsoft.AspNetCore.Http.HttpContext.Response" /> to "no-store". 36/// Gets or sets the value for the Vary header in <see cref="Microsoft.AspNetCore.Http.HttpContext.Response" />.
ChallengeResult.cs (1)
95var httpContext = context.HttpContext;
ControllerBase.cs (2)
35/// Gets the <see cref="Http.HttpContext"/> for the executing action. 37public HttpContext HttpContext => ControllerContext.HttpContext;
ControllerContext.cs (2)
49/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 53HttpContext httpContext,
Diagnostics\MvcDiagnostics.cs (4)
27public BeforeActionEventData(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) 42public HttpContext HttpContext { get; } 78public AfterActionEventData(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) 93public HttpContext HttpContext { get; }
Filters\IMiddlewareFilterFeature.cs (1)
7/// A feature in <see cref="Microsoft.AspNetCore.Http.HttpContext.Features"/> which is used to capture the
Filters\MiddlewareFilter.cs (1)
24var httpContext = context.HttpContext;
ForbidResult.cs (1)
95var httpContext = context.HttpContext;
Formatters\SystemTextJsonInputFormatter.cs (1)
65var httpContext = context.HttpContext;
Formatters\SystemTextJsonOutputFormatter.cs (1)
66var httpContext = context.HttpContext;
Infrastructure\ControllerEndpointFilterInvocationContext.cs (1)
40public override HttpContext HttpContext => ActionContext.HttpContext;
Infrastructure\DefaultProblemDetailsFactory.cs (3)
39HttpContext httpContext, 64HttpContext httpContext, 95private void ApplyProblemDetailsDefaults(HttpContext httpContext, ProblemDetails problemDetails, int statusCode)
Infrastructure\FileResultExecutorBase.cs (2)
89/// <param name="context">The <see cref="HttpContext"/>.</param> 94protected static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength)
Infrastructure\PhysicalFileResultExecutor.cs (1)
64HttpContext httpContext,
Infrastructure\ProblemDetailsFactory.cs (4)
17/// <param name="httpContext">The <see cref="HttpContext" />.</param> 25HttpContext httpContext, 35/// <param name="httpContext">The <see cref="HttpContext" />.</param> 44HttpContext httpContext,
Infrastructure\VirtualFileResultExecutor.cs (1)
75HttpContext httpContext,
ModelBinding\Binders\BodyModelBinder.cs (1)
106var httpContext = bindingContext.HttpContext;
MvcCoreDiagnosticListenerExtensions.cs (4)
23HttpContext httpContext, 38private static void BeforeActionImpl(DiagnosticListener diagnosticListener, ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) 51HttpContext httpContext, 66private static void AfterActionImpl(DiagnosticListener diagnosticListener, ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData)
Routing\ActionConstraintMatcherPolicy.cs (3)
76public Task ApplyAsync(HttpContext httpContext, CandidateSet candidateSet) 103HttpContext httpContext, 155HttpContext httpContext,
Routing\ControllerLinkGeneratorExtensions.cs (6)
20/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 42HttpContext httpContext, 100/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 136HttpContext httpContext, 206private static RouteValuesAddress CreateAddress(HttpContext? httpContext, string? action, string? controller, object? values) 220private static RouteValueDictionary? GetAmbientValues(HttpContext? httpContext)
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
58public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Routing\DynamicRouteValueTransformer.cs (13)
20/// The route values returned from a <see cref="TransformAsync(HttpContext, RouteValueDictionary)"/> implementation 23/// <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> as well as 32/// <item><description><see cref="TransformAsync(HttpContext, RouteValueDictionary)"/></description></item> 33/// <item><description><see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /></description></item> 59/// <param name="httpContext">The <see cref="HttpContext" /> associated with the current request.</param> 62public abstract ValueTask<RouteValueDictionary> TransformAsync(HttpContext httpContext, RouteValueDictionary values); 66/// <see cref="TransformAsync(HttpContext, RouteValueDictionary)" />. 68/// <param name="httpContext">The <see cref="HttpContext" /> associated with the current request.</param> 69/// <param name="values">The route values returned from <see cref="TransformAsync(HttpContext, RouteValueDictionary)" />.</param> 72/// <see cref="TransformAsync(HttpContext, RouteValueDictionary)" />. 77/// Implementations of <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> may further 82/// <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> will not be called in the case 86public virtual ValueTask<IReadOnlyList<Endpoint>> FilterAsync(HttpContext httpContext, RouteValueDictionary values, IReadOnlyList<Endpoint> endpoints)
Routing\KnownRouteValueConstraint.cs (2)
35HttpContext? httpContext, 65private ActionDescriptorCollection GetAndValidateActionDescriptors(HttpContext? httpContext)
Routing\PageLinkGeneratorExtensions.cs (6)
20/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 41HttpContext httpContext, 102/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 137HttpContext httpContext, 206private static RouteValuesAddress CreateAddress(HttpContext? httpContext, string? page, string? handler, object? values) 220private static RouteValueDictionary? GetAmbientValues(HttpContext? httpContext)
Routing\UrlHelper.cs (2)
26/// Gets the <see cref="Http.HttpContext"/> associated with the current request. 28protected HttpContext HttpContext => ActionContext.HttpContext;
Routing\UrlHelperBase.cs (2)
296internal static string? Content(HttpContext httpContext, string? contentPath) 405nameof(HttpContext)));
Routing\UrlHelperFactory.cs (3)
21var httpContext = context.HttpContext; 33nameof(HttpContext.Items), 34nameof(HttpContext)));
SignInResult.cs (1)
82var httpContext = context.HttpContext;
SignOutResult.cs (2)
98Task IResult.ExecuteAsync(HttpContext httpContext) 103private async Task ExecuteAsync(HttpContext httpContext)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (4)
90public string? GetRequestCookie(HttpContext context, string key) 145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (4)
18/// Provides a parser for the Range Header in an <see cref="HttpContext.Request"/>. 23/// Returns the normalized form of the requested range if the Range Header in the <see cref="HttpContext.Request"/> is valid. 25/// <param name="context">The <see cref="HttpContext"/> associated with the request.</param> 35HttpContext context,
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (5)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength) 91HttpContext httpContext, 287HttpContext httpContext, 343private static void SetContentDispositionHeader(HttpContext httpContext, in FileResultInfo result)
src\aspnetcore\src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
14internal static string? Content(HttpContext httpContext, string? contentPath)
StatusCodeResult.cs (1)
38var httpContext = context.HttpContext;
UrlHelperExtensions.cs (2)
525var httpContext = helper.ActionContext.HttpContext; 574var httpContext = urlHelper.ActionContext.HttpContext;
Microsoft.AspNetCore.Mvc.Cors (1)
CorsAuthorizationFilter.cs (1)
74var httpContext = context.HttpContext;
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
221var httpContext = context.HttpContext;
XmlSerializerOutputFormatter.cs (1)
200var httpContext = context.HttpContext;
Microsoft.AspNetCore.Mvc.Razor (7)
Diagnostics\MvcDiagnostics.cs (4)
30public BeforeViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) 56public HttpContext HttpContext { get; } 91public AfterViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) 117public HttpContext HttpContext { get; }
LanguageViewLocationExpander.cs (1)
10/// that is getting added as extension prefix comes from <see cref="Microsoft.AspNetCore.Http.HttpContext"/>.
RazorPage.cs (2)
21/// An <see cref="HttpContext"/> representing the current request execution. 23public HttpContext Context => ViewContext?.HttpContext!;
Microsoft.AspNetCore.Mvc.RazorPages (7)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
61public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
PageBase.cs (2)
40/// Gets the <see cref="Http.HttpContext"/>. 42public HttpContext HttpContext => PageContext?.HttpContext!;
PageContext.cs (2)
46/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 50HttpContext httpContext,
PageModel.cs (2)
59/// Gets the <see cref="Http.HttpContext"/>. 61public HttpContext HttpContext => PageContext.HttpContext;
Microsoft.AspNetCore.Mvc.TagHelpers (2)
Cache\CacheTagKey.cs (1)
81var httpContext = tagHelper.ViewContext.HttpContext;
CacheTagHelperBase.cs (1)
92/// <see cref="Http.HttpContext.User"/>.
Microsoft.AspNetCore.Mvc.ViewFeatures (26)
AntiforgeryExtensions.cs (2)
22/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 31public static IHtmlContent GetHtml(this IAntiforgery antiforgery, HttpContext httpContext)
CookieTempDataProvider.cs (5)
54/// <param name="context">The <see cref="HttpContext"/>.</param> 56public IDictionary<string, object> LoadTempData(HttpContext context) 100/// <param name="context">The <see cref="HttpContext"/>.</param> 102public void SaveTempData(HttpContext context, IDictionary<string, object> values) 123private void SetCookiePath(HttpContext httpContext, CookieOptions cookieOptions)
Filters\SaveTempDataFilter.cs (4)
14private static readonly Func<object, Task> OnStartingCallback = (state) => OnStarting((HttpContext)state); 50private static Task OnStarting(HttpContext httpContext) 108private static SaveTempDataContext GetTempDataContext(HttpContext httpContext) 122HttpContext httpContext)
ITempDataDictionaryFactory.cs (2)
18/// <param name="context">The <see cref="HttpContext"/>.</param> 23ITempDataDictionary GetTempData(HttpContext context);
ITempDataProvider.cs (4)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 18IDictionary<string, object> LoadTempData(HttpContext context); 23/// <param name="context">The <see cref="HttpContext"/>.</param> 25void SaveTempData(HttpContext context, IDictionary<string, object> values);
Rendering\HtmlHelperComponentExtensions.cs (1)
62var httpContext = htmlHelper.ViewContext.HttpContext;
SessionStateTempDataProvider.cs (2)
28public virtual IDictionary<string, object> LoadTempData(HttpContext context) 47public virtual void SaveTempData(HttpContext context, IDictionary<string, object> values)
TempDataDictionary.cs (3)
25private readonly HttpContext _context; 32/// <param name="context">The <see cref="HttpContext"/>.</param> 34public TempDataDictionary(HttpContext context, ITempDataProvider provider)
TempDataDictionaryFactory.cs (1)
29public ITempDataDictionary GetTempData(HttpContext context)
ViewComponent.cs (2)
32/// Gets the <see cref="Http.HttpContext"/>. 34public HttpContext HttpContext => ViewContext?.HttpContext!;
Microsoft.AspNetCore.OutputCaching (18)
OutputCacheContext.cs (1)
43public required HttpContext HttpContext { get; init; }
OutputCacheMiddleware.cs (5)
86/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 88public Task Invoke(HttpContext httpContext) 99private async Task InvokeAwaited(HttpContext httpContext, IReadOnlyList<IOutputCachePolicy> policies) 222internal bool TryGetRequestPolicies(HttpContext httpContext, out IReadOnlyList<IOutputCachePolicy> policies) 505internal static void RemoveOutputCacheFeature(HttpContext context) =>
OutputCachePolicyBuilder.cs (8)
170ValueTask<string> varyByKeyFunc(HttpContext context, CancellationToken cancellationToken) 182public OutputCachePolicyBuilder SetCacheKeyPrefix(Func<HttpContext, string> keyPrefix) 186ValueTask<string> varyByKeyFunc(HttpContext context, CancellationToken cancellationToken) 198public OutputCachePolicyBuilder SetCacheKeyPrefix(Func<HttpContext, CancellationToken, ValueTask<string>> keyPrefix) 215ValueTask<KeyValuePair<string, string>> varyByFunc(HttpContext context, CancellationToken cancellationToken) 227public OutputCachePolicyBuilder VaryByValue(Func<HttpContext, KeyValuePair<string, string>> varyBy) 231ValueTask<KeyValuePair<string, string>> varyByFunc(HttpContext context, CancellationToken cancellationToken) 243public OutputCachePolicyBuilder VaryByValue(Func<HttpContext, CancellationToken, ValueTask<KeyValuePair<string, string>>> varyBy)
Policies\SetCacheKeyPrefixPolicy.cs (2)
13private readonly Func<HttpContext, CacheVaryByRules, CancellationToken, ValueTask> _varyByAsync; 18public SetCacheKeyPrefixPolicy(Func<HttpContext, CancellationToken, ValueTask<string>> varyBy)
Policies\VaryByValuePolicy.cs (2)
13private readonly Func<HttpContext, CacheVaryByRules, CancellationToken, ValueTask> _varyByAsync; 18public VaryByValuePolicy(Func<HttpContext, CancellationToken, ValueTask<KeyValuePair<string, string>>> varyBy)
Microsoft.AspNetCore.RateLimiting (21)
DefaultRateLimiterPolicy.cs (3)
11private readonly Func<HttpContext, RateLimitPartition<DefaultKeyType>> _partitioner; 14public DefaultRateLimiterPolicy(Func<HttpContext, RateLimitPartition<DefaultKeyType>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected) 22public RateLimitPartition<DefaultKeyType> GetPartition(HttpContext httpContext)
IRateLimiterPolicy.cs (3)
20/// Gets the <see cref="RateLimitPartition{TPartitionKey}"/> that applies to the given <see cref="HttpContext"/>. 22/// <param name="httpContext">The <see cref="HttpContext"/> to get the partition for.</param> 23RateLimitPartition<TPartitionKey> GetPartition(HttpContext httpContext);
OnRejectedContext.cs (1)
17public required HttpContext HttpContext { get; init; }
RateLimiterOptions.cs (4)
26public PartitionedRateLimiter<HttpContext>? GlobalLimiter { get; set; } 48public RateLimiterOptions AddPolicy<TPartitionKey>(string policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner) 109internal static Func<HttpContext, RateLimitPartition<DefaultKeyType>> ConvertPartitioner<TPartitionKey>(string? policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner)
RateLimitingMiddleware.cs (10)
21private readonly PartitionedRateLimiter<HttpContext>? _globalLimiter; 22private readonly PartitionedRateLimiter<HttpContext> _endpointLimiter; 63/// <param name="context">The <see cref="HttpContext"/>.</param> 65public Task Invoke(HttpContext context) 83private async Task InvokeInternal(HttpContext context, EnableRateLimitingAttribute? enableRateLimitingAttribute) 151private async ValueTask<LeaseContext> TryAcquireAsync(HttpContext context, MetricsContext metricsContext) 179private LeaseContext CombinedAcquire(HttpContext context) 210private async ValueTask<LeaseContext> CombinedWaitAsync(HttpContext context, CancellationToken cancellationToken) 252private PartitionedRateLimiter<HttpContext> CreateEndpointLimiter() 255return PartitionedRateLimiter.Create<HttpContext, DefaultKeyType>(context =>
Microsoft.AspNetCore.RequestDecompression (6)
DefaultRequestDecompressionProvider.cs (1)
30public Stream? GetDecompressionStream(HttpContext context)
IRequestDecompressionProvider.cs (2)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 18Stream? GetDecompressionStream(HttpContext context);
RequestDecompressionMiddleware.cs (3)
43/// <param name="context">The <see cref="HttpContext"/>.</param> 45public Task Invoke(HttpContext context) 56private async Task InvokeCore(HttpContext context, Stream decompressionStream)
Microsoft.AspNetCore.ResponseCaching (6)
ResponseCachingContext.cs (2)
23internal ResponseCachingContext(HttpContext httpContext, ILogger logger) 29public HttpContext HttpContext { get; }
ResponseCachingMiddleware.cs (4)
83/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 85public async Task Invoke(HttpContext httpContext) 429internal static void AddResponseCachingFeature(HttpContext context) 453internal static void RemoveResponseCachingFeature(HttpContext context) =>
Microsoft.AspNetCore.ResponseCompression (18)
IResponseCompressionProvider.cs (6)
16/// <param name="context">The <see cref="HttpContext"/>.</param> 18ICompressionProvider? GetCompressionProvider(HttpContext context); 23/// <param name="context">The <see cref="HttpContext"/>.</param> 25bool ShouldCompressResponse(HttpContext context); 30/// <param name="context">The <see cref="HttpContext"/>.</param> 32bool CheckRequestAcceptsCompression(HttpContext context);
ResponseCompressionBody.cs (4)
17private readonly HttpContext _context; 30internal ResponseCompressionBody(HttpContext context, IResponseCompressionProvider provider, 202/// <param name="context">The <see cref="HttpContext"/>.</param> 204internal static bool ShouldCompressResponseCommon(IResponseCompressionProvider provider, HttpContext context)
ResponseCompressionMiddleware.cs (5)
35/// <param name="context">The <see cref="HttpContext"/>.</param> 37public Task Invoke(HttpContext context) 50HttpContext context = (HttpContext)state; 54private async Task InvokeCore(HttpContext context)
ResponseCompressionProvider.cs (3)
76public virtual ICompressionProvider? GetCompressionProvider(HttpContext context) 164public virtual bool ShouldCompressResponse(HttpContext context) 220public bool CheckRequestAcceptsCompression(HttpContext context)
Microsoft.AspNetCore.Rewrite (4)
RewriteContext.cs (1)
20public HttpContext HttpContext { get; set; } = default!;
RewriteMiddleware.cs (3)
50/// <param name="context">The <see cref="HttpContext"/> for the current request.</param> 52public Task Invoke(HttpContext context) 88static void RunRules(RewriteContext rewriteContext, RewriteOptions options, HttpContext httpContext, ILogger logger)
Microsoft.AspNetCore.Routing (105)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (4)
33/// is associated with the <see cref="HttpContext"/>. Middleware between <see cref="UseRouting(IApplicationBuilder)"/> 35/// <see cref="Endpoint"/> associated with the <see cref="HttpContext"/>. 80/// is associated with the <see cref="HttpContext"/>. Middleware between <see cref="UseRouting(IApplicationBuilder)"/> 82/// <see cref="Endpoint"/> associated with the <see cref="HttpContext"/>.
Builder\RoutingEndpointConventionBuilderExtensions.cs (1)
36/// Verify the local port where the connection was accepted using <see cref="HttpContext.Connection"/> (specifically <see cref="ConnectionInfo.LocalPort"/>).
Constraints\BoolRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\CompositeRouteConstraint.cs (1)
40HttpContext? httpContext,
Constraints\DateTimeRouteConstraint.cs (1)
32HttpContext? httpContext,
Constraints\DecimalRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\DoubleRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\FileNameRouteConstraint.cs (1)
97HttpContext? httpContext,
Constraints\FloatRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\GuidRouteConstraint.cs (1)
28HttpContext? httpContext,
Constraints\HttpMethodRouteConstraint.cs (1)
34HttpContext? httpContext,
Constraints\IntRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\LengthRouteConstraint.cs (1)
82HttpContext? httpContext,
Constraints\LongRouteConstraint.cs (1)
26HttpContext? httpContext,
Constraints\MaxLengthRouteConstraint.cs (1)
46HttpContext? httpContext,
Constraints\MaxRouteConstraint.cs (1)
40HttpContext? httpContext,
Constraints\MinLengthRouteConstraint.cs (1)
46HttpContext? httpContext,
Constraints\MinRouteConstraint.cs (1)
40HttpContext? httpContext,
Constraints\NonFileNameRouteConstraint.cs (1)
93HttpContext? httpContext,
Constraints\NullRouteConstraint.cs (1)
21public bool Match(HttpContext? httpContext, IRouter? route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
Constraints\OptionalRouteConstraint.cs (1)
40HttpContext? httpContext,
Constraints\RangeRouteConstraint.cs (1)
54HttpContext? httpContext,
Constraints\RegexErrorStubRouteConstraint.cs (1)
24bool IRouteConstraint.Match(HttpContext? httpContext, IRouter? route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
Constraints\RegexRouteConstraint.cs (1)
81HttpContext? httpContext,
Constraints\RequiredRouteConstraint.cs (1)
20HttpContext? httpContext,
Constraints\StringRouteConstraint.cs (1)
29public bool Match(HttpContext? httpContext, IRouter? route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
DefaultLinkGenerator.cs (5)
70HttpContext httpContext, 120HttpContext httpContext, 200HttpContext? httpContext, 281HttpContext? httpContext, 317public static RouteValueDictionary? GetAmbientValues(HttpContext? httpContext)
EndpointMiddleware.cs (1)
33public Task Invoke(HttpContext httpContext)
EndpointRoutingMiddleware.cs (7)
59public Task Invoke(HttpContext httpContext) 86static async Task AwaitMatcher(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task<Matcher> matcherTask) 93static async Task AwaitMatch(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask) 101private Task SetRoutingAndContinue(HttpContext httpContext) 151static void Write(DiagnosticListener diagnosticListener, HttpContext httpContext) 158private Task ExecuteShortCircuit(ShortCircuitMetadata shortCircuitMetadata, Endpoint endpoint, HttpContext httpContext) 302private void SetMaxRequestBodySize(HttpContext context)
LinkGeneratorEndpointNameAddressExtensions.cs (8)
19/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 34HttpContext httpContext, 59/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 74HttpContext httpContext, 155/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 185HttpContext httpContext, 214/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 244HttpContext httpContext,
LinkGeneratorRouteValuesAddressExtensions.cs (9)
19/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 34HttpContext httpContext, 59/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 74HttpContext httpContext, 155/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 185HttpContext httpContext, 214/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 244HttpContext httpContext, 355private static RouteValuesAddress CreateAddress(HttpContext? httpContext, string? routeName, RouteValueDictionary? values)
Matching\AcceptsMatcherPolicy.cs (2)
47public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 356public override int GetDestination(HttpContext httpContext)
Matching\ContentEncodingNegotiationMatcherPolicy.cs (1)
17private protected override StringValues GetNegotiationHeader(HttpContext httpContext) => httpContext.Request.Headers[HeaderName];
Matching\DataSourceDependentMatcher.cs (1)
33public override Task MatchAsync(HttpContext httpContext)
Matching\DefaultEndpointSelector.cs (3)
12HttpContext httpContext, 22internal static void Select(HttpContext httpContext, Span<CandidateState> candidateState) 57HttpContext httpContext,
Matching\DfaMatcher.cs (4)
32public sealed override unsafe Task MatchAsync(HttpContext httpContext) 210HttpContext httpContext, 300HttpContext httpContext, 317HttpContext httpContext,
Matching\EndpointSelector.cs (3)
18/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 23/// <see cref="EndpointHttpContextExtensions.SetEndpoint(HttpContext, Endpoint)"/> 26public abstract Task SelectAsync(HttpContext httpContext, CandidateSet candidates);
Matching\HostMatcherPolicy.cs (3)
71public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 338private static (string host, int? port) GetHostAndPort(HttpContext httpContext) 381public override int GetDestination(HttpContext httpContext)
Matching\HttpMethodDictionaryPolicyJumpTable.cs (1)
21public override int GetDestination(HttpContext httpContext)
Matching\HttpMethodMatcherPolicy.cs (2)
78public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 419internal static bool IsCorsPreflightRequest(HttpContext httpContext, string httpMethod, out StringValues accessControlRequestMethod)
Matching\HttpMethodSingleEntryPolicyJumpTable.cs (1)
34public override int GetDestination(HttpContext httpContext)
Matching\IEndpointSelectorPolicy.cs (3)
30/// The <see cref="HttpContext"/> associated with the current request. 41/// calling <see cref="EndpointHttpContextExtensions.SetEndpoint(HttpContext, Endpoint)"/> 46Task ApplyAsync(HttpContext httpContext, CandidateSet candidates);
Matching\Matcher.cs (2)
17/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 19public abstract Task MatchAsync(HttpContext httpContext);
Matching\NegotiationMatcherPolicy.cs (3)
48private protected abstract StringValues GetNegotiationHeader(HttpContext httpContext); 82public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 429public override int GetDestination(HttpContext httpContext)
Matching\PolicyJumpTable.cs (2)
16/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 17public abstract int GetDestination(HttpContext httpContext);
RequestDelegateFilterPipelineBuilder.cs (1)
54return async (HttpContext httpContext) =>
RouteBase.cs (2)
289private void EnsureBinder(HttpContext context) 299private void EnsureLoggers(HttpContext context)
RouteCollection.cs (1)
191private void EnsureOptions(HttpContext context)
RouteConstraintMatcher.cs (2)
28/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 39HttpContext httpContext,
RouteHandler.cs (1)
27public RequestDelegate GetRequestHandler(HttpContext httpContext, RouteData routeData)
RouterMiddleware.cs (2)
40/// <param name="httpContext">A <see cref="HttpContext"/> instance.</param> 41public async Task Invoke(HttpContext httpContext)
src\aspnetcore\src\Shared\HttpExtensions.cs (2)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 49internal static void ClearEndpoint(HttpContext context)
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 31public static void SetPlaintextContentType(HttpContext httpContext)
Template\TemplateBinder.cs (2)
426/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 431public bool TryProcessConstraints(HttpContext? httpContext, RouteValueDictionary combinedValues, out string? parameterName, out IRouteConstraint? constraint)
Microsoft.AspNetCore.Routing.Abstractions (24)
IRouteConstraint.cs (1)
36HttpContext? httpContext,
IRouteHandler.cs (2)
17/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 22RequestDelegate GetRequestHandler(HttpContext httpContext, RouteData routeData);
LinkGenerator.cs (6)
29/// Generates a URI with an absolute path based on the provided values and <see cref="HttpContext"/>. 32/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 47HttpContext httpContext, 77/// Generates an absolute URI based on the provided values and <see cref="HttpContext"/>. 80/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 110HttpContext httpContext,
RouteContext.cs (4)
18/// <param name="httpContext">The <see cref="Http.HttpContext"/> associated with the current request.</param> 19public RouteContext(HttpContext httpContext) 33/// Gets the <see cref="Http.HttpContext"/> associated with the current request. 35public HttpContext HttpContext { get; }
RoutingHttpContextExtensions.cs (5)
12/// Extension methods for <see cref="HttpContext"/> related to routing. 19/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 21public static RouteData GetRouteData(this HttpContext httpContext) 33/// <param name="httpContext">The <see cref="HttpContext"/> associated with the current request.</param> 36public static object? GetRouteValue(this HttpContext httpContext, string key)
VirtualPathContext.cs (6)
16/// <param name="httpContext">The <see cref="Http.HttpContext"/> associated with the current request.</param> 20HttpContext httpContext, 30/// <param name="httpContext">The <see cref="Http.HttpContext"/> associated with the current request.</param> 35HttpContext httpContext, 52/// Gets the <see cref="Http.HttpContext"/> associated with the current request. 54public HttpContext HttpContext { get; }
Microsoft.AspNetCore.Server.IIS (4)
SourceBuildStubs.cs (4)
39/// Gets or sets a value that controls whether synchronous IO is allowed for the <see cref="HttpContext.Request"/> and <see cref="HttpContext.Response"/> 94/// Extensions to <see cref="HttpContext"/> that enable access to IIS features. 108public static string? GetIISServerVariable(this HttpContext context, string variableName) => null;
Microsoft.AspNetCore.Server.IISIntegration (7)
AuthenticationHandler.cs (2)
14private HttpContext? _context; 48public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context)
IISMiddleware.cs (5)
99/// <param name="httpContext">The <see cref="HttpContext"/>.</param> 101public Task Invoke(HttpContext httpContext) 170private static WindowsPrincipal? GetUser(HttpContext context) 194var context = (HttpContext)arg;
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Http\HttpProtocol.cs (1)
121/// The request id. <seealso cref="HttpContext.TraceIdentifier"/>
KestrelServerOptions.cs (2)
113/// Gets or sets a value that controls whether synchronous IO is allowed for the <see cref="HttpContext.Request"/> and <see cref="HttpContext.Response"/>
Microsoft.AspNetCore.Session (4)
SessionMiddleware.cs (4)
58/// <param name="context">The <see cref="HttpContext"/>.</param> 60public async Task Invoke(HttpContext context) 116private readonly HttpContext _context; 121public SessionEstablisher(HttpContext context, string cookieValue, SessionOptions options)
Microsoft.AspNetCore.SignalR (7)
GetHttpContextExtensions.cs (7)
10/// Extension methods for accessing <see cref="HttpContext"/> from a hub context. 15/// Gets <see cref="HttpContext"/> from the specified connection, or <c>null</c> if the connection is not associated with an HTTP request. 18/// <returns>The <see cref="HttpContext"/> for the connection, or <c>null</c> if the connection is not associated with an HTTP request.</returns> 19public static HttpContext? GetHttpContext(this HubCallerContext connection) 26/// Gets <see cref="HttpContext"/> from the specified connection, or <c>null</c> if the connection is not associated with an HTTP request. 29/// <returns>The <see cref="HttpContext"/> for the connection, or <c>null</c> if the connection is not associated with an HTTP request.</returns> 30public static HttpContext? GetHttpContext(this HubConnectionContext connection)
Microsoft.AspNetCore.StaticAssets (12)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
150private readonly HttpContext _context; 153public RuntimeStaticAssetResponseBodyFeature(IHttpResponseBodyFeature original, HttpContext context, StaticAssetDescriptor asset) 296var ctx = (HttpContext)context; 402public bool Match(HttpContext? httpContext, IRouter? route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (4)
18/// Provides a parser for the Range Header in an <see cref="HttpContext.Request"/>. 23/// Returns the normalized form of the requested range if the Range Header in the <see cref="HttpContext.Request"/> is valid. 25/// <param name="context">The <see cref="HttpContext"/> associated with the request.</param> 35HttpContext context,
StaticAssetsInvoker.cs (3)
127public async Task Invoke(HttpContext context) 254private readonly HttpContext _context = null!; 263HttpContext context,
Microsoft.AspNetCore.StaticFiles (20)
DefaultFilesMiddleware.cs (1)
49public Task Invoke(HttpContext context)
DirectoryBrowserMiddleware.cs (1)
61public Task Invoke(HttpContext context)
Helpers.cs (2)
41internal static void RedirectToPathWithSlash(HttpContext context) 49internal static bool TryMatchPath(HttpContext context, PathString matchUrl, bool forDirectory, out PathString subpath)
HtmlDirectoryFormatter.cs (1)
35public virtual Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents)
IDirectoryFormatter.cs (1)
19Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents);
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (4)
18/// Provides a parser for the Range Header in an <see cref="HttpContext.Request"/>. 23/// Returns the normalized form of the requested range if the Range Header in the <see cref="HttpContext.Request"/> is valid. 25/// <param name="context">The <see cref="HttpContext"/> associated with the request.</param> 35HttpContext context,
StaticFileContext.cs (3)
18private readonly HttpContext _context; 44public StaticFileContext(HttpContext context, StaticFileOptions options, ILogger logger, IFileProvider fileProvider, string? contentType, PathString subPath) 304public async Task ServeStaticFile(HttpContext context, RequestDelegate next)
StaticFileMiddleware.cs (5)
58public Task Invoke(HttpContext context) 86private static bool ValidateNoEndpointDelegate(HttpContext context) => context.GetEndpoint()?.RequestDelegate is null; 88private static bool ValidateMethod(HttpContext context) 93internal static bool ValidatePath(HttpContext context, PathString matchUrl, out PathString subPath) => Helpers.TryMatchPath(context, matchUrl, forDirectory: false, out subPath); 111private Task TryServeStaticFile(HttpContext context, string? contentType, PathString subPath)
StaticFileResponseContext.cs (2)
19public StaticFileResponseContext(HttpContext context, IFileInfo file) 28public HttpContext Context { get; }
Microsoft.AspNetCore.Testing.Tests (1)
TestResources\Startup.cs (1)
19public void Configure(IApplicationBuilder app) => app.Use((HttpContext _, Func<Task> _) => Task.CompletedTask);
Microsoft.AspNetCore.Watch.BrowserRefresh (10)
src\sdk\src\Dotnet.Watch\Web.Middleware\BlazorWasmHotReloadMiddleware.cs (3)
50public Task InvokeAsync(HttpContext context) 74private async Task OnGet(HttpContext context) 85private async Task OnPost(HttpContext context)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (4)
38public async Task InvokeAsync(HttpContext context) 88private void AttachWebAssemblyHeaders(HttpContext context) 128internal static bool IsWebAssemblyBootRequest(HttpContext context) 168internal static bool IsBrowserDocumentRequest(HttpContext context)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserScriptMiddleware.cs (1)
37public async Task InvokeAsync(HttpContext context)
src\sdk\src\Dotnet.Watch\Web.Middleware\ResponseStreamWrapper.cs (2)
28private readonly HttpContext _context; 38public ResponseStreamWrapper(HttpContext context, ILogger logger)
Microsoft.AspNetCore.WebSockets (10)
AbortStream.cs (4)
10/// Used in <see cref="WebSocketMiddleware"/> to wrap the <see cref="HttpContext"/>.Request.Body stream 11/// so that we can call <see cref="HttpContext.Abort"/> when the stream is disposed and the WebSocket is in the <see cref="WebSocketState.Aborted"/> state. 23private readonly HttpContext _httpContext; 27public AbortStream(HttpContext httpContext, Stream innerStream)
WebSocketMiddleware.cs (6)
19/// to the <see cref="HttpContext"/> if the request is a valid WebSocket request. 52/// sets the <see cref="IHttpWebSocketFeature"/> on the <see cref="HttpContext.Features"/>. 54/// <param name="context">The <see cref="HttpContext"/> representing the request.</param> 56public Task Invoke(HttpContext context) 91private readonly HttpContext _context; 99public WebSocketHandshake(HttpContext context, IHttpUpgradeFeature? upgradeFeature, IHttpExtendedConnectFeature? connectFeature, WebSocketOptions options, ILogger logger)
Microsoft.DotNet.HotReload.Watch (11)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (6)
248private bool TryAcceptRequest(HttpContext context) 268private async Task HandleInfoRequestAsync(HttpContext context) 279private async Task HandleSessionNotifyRequestAsync(HttpContext context) 307private bool IsValidAuthentication(HttpContext context) 323private async Task HandleStartSessionRequestAsync(HttpContext context) 422private async Task HandleStopSessionRequestAsync(HttpContext context, string sessionId)
src\sdk\src\Dotnet.Watch\AspireService\Helpers\HttpContextExtensions.cs (3)
19public static string? GetApiVersion(this HttpContext context) 29public static string GetDcpId(this HttpContext context) 45public static async Task<ProjectLaunchRequest?> GetProjectLaunchInformationAsync(this HttpContext context, CancellationToken cancelToken)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\BrowserRefreshServer.cs (1)
50private async Task WebSocketRequestAsync(HttpContext context)
src\sdk\src\Dotnet.Watch\HotReloadClient\WebSocketClientTransport.cs (1)
117public async Task HandleRequestAsync(HttpContext context)
Stress.ApiService (1)
Program.cs (1)
863app.MapGet("/big-nested-trace", async (HttpContext context) =>
WebPubSubWeb (1)
Program.cs (1)
53app.Map($"/eventhandler/{Constants.ChatHubName}", async ([FromKeyedServices(Constants.ChatHubName)] WebPubSubServiceClient service, HttpContext context, ILogger logger) =>