1 write to HttpContext
Microsoft.AspNetCore.Diagnostics (1)
StatusCodePage\StatusCodeContext.cs (1)
22
HttpContext
= context;
31 references to HttpContext
Microsoft.AspNetCore.Diagnostics (31)
StatusCodePage\StatusCodeContext.cs (2)
17
/// <param name="context">The <see cref="
HttpContext
"/>.</param>
28
/// Gets the <see cref="
HttpContext
"/>.
StatusCodePage\StatusCodePagesExtensions.cs (24)
78
var body = string.Format(CultureInfo.InvariantCulture, bodyFormat, context.
HttpContext
.Response.StatusCode);
79
context.
HttpContext
.Response.ContentType = contentType;
80
return context.
HttpContext
.Response.WriteAsync(body);
101
var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.
HttpContext
.Response.StatusCode);
102
context.
HttpContext
.Response.Redirect(context.
HttpContext
.Request.PathBase + location);
110
var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.
HttpContext
.Response.StatusCode);
111
context.
HttpContext
.Response.Redirect(location);
131
return app.UseStatusCodePages(context => tangent(context.
HttpContext
));
167
var originalStatusCode = context.
HttpContext
.Response.StatusCode;
175
var originalPath = context.
HttpContext
.Request.Path;
176
var originalQueryString = context.
HttpContext
.Request.QueryString;
178
var routeValuesFeature = context.
HttpContext
.Features.Get<IRouteValuesFeature>();
181
context.
HttpContext
.Features.Set<IStatusCodeReExecuteFeature>(new StatusCodeReExecuteFeature()
183
OriginalPathBase = context.
HttpContext
.Request.PathBase.Value!,
187
Endpoint = context.
HttpContext
.GetEndpoint(),
193
HttpExtensions.ClearEndpoint(context.
HttpContext
);
195
context.
HttpContext
.Request.Path = newPath;
196
context.
HttpContext
.Request.QueryString = newQueryString;
201
await next(context.
HttpContext
);
205
await context.Next(context.
HttpContext
);
210
context.
HttpContext
.Request.QueryString = originalQueryString;
211
context.
HttpContext
.Request.Path = originalPath;
212
context.
HttpContext
.Features.Set<IStatusCodeReExecuteFeature?>(null);
StatusCodePage\StatusCodePagesOptions.cs (5)
25
var statusCode = context.
HttpContext
.Response.StatusCode;
26
var problemDetailsService = context.
HttpContext
.RequestServices.GetService<IProblemDetailsService>();
29
!await problemDetailsService.TryWriteAsync(new() { HttpContext = context.
HttpContext
, ProblemDetails = { Status = statusCode } }))
34
context.
HttpContext
.Response.ContentType = "text/plain";
35
await context.
HttpContext
.Response.WriteAsync(body);