1 override of StatusCode
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
56public override int StatusCode
452 writes to StatusCode
Aspire.Dashboard (3)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (3)
129context.Response.StatusCode = ex.StatusCode; 134context.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType; 162httpContext.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType;
BasicWebSite (1)
Controllers\TestingController.cs (1)
109context.HttpContext.Response.StatusCode = (int)_statusCode;
Benchmarks (2)
StartupUsingEndpointRouting.cs (1)
31response.StatusCode = 200;
StartupUsingRouter.cs (1)
25response.StatusCode = 200;
blazor-devserver (1)
Server\Startup.cs (1)
99context.Response.StatusCode = 404;
CustomAuthorizationFailureResponse (1)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
45httpContext.Response.StatusCode = (int)HttpStatusCode.NotFound;
Diagnostics.EFCore.FunctionalTests (2)
DatabaseErrorPageMiddlewareTest.cs (1)
56context.Response.StatusCode = (int)HttpStatusCode.OK;
MigrationsEndPointMiddlewareTest.cs (1)
53context.Response.StatusCode = (int)HttpStatusCode.OK;
ExceptionHandlerSample (1)
Startup.cs (1)
19context.Response.StatusCode = 500;
FormatterWebSite (1)
Controllers\JsonFormatterController.cs (1)
76Response.StatusCode = StatusCodes.Status400BadRequest;
GenericHostWebSite (1)
Controllers\TestingController.cs (1)
95context.HttpContext.Response.StatusCode = (int)_statusCode;
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
67response.StatusCode = 200;
InMemory.FunctionalTests (16)
Http2\Http2WebSocketTests.cs (3)
175context.Response.StatusCode = StatusCodes.Status201Created; // Any 2XX should work 531context.Response.StatusCode = Http.StatusCodes.Status418ImATeapot; 603context.Response.StatusCode = StatusCodes.Status201Created; // Any 2XX should work
Http3\Http3StreamTests.cs (1)
56context.Response.StatusCode = 401;
MaxRequestBodySizeTests.cs (2)
84context.Response.StatusCode = requestRejectedEx.StatusCode; 131context.Response.StatusCode = requestRejectedEx.StatusCode;
ResponseTests.cs (10)
554httpContext.Response.StatusCode = statusCode; 579httpContext.Response.StatusCode = 205; 679httpContext.Response.StatusCode = statusCode; 717httpContext.Response.StatusCode = statusCode; 757httpContext.Response.StatusCode = 205; 796httpContext.Response.StatusCode = statusCode; 838httpContext.Response.StatusCode = 205; 1546httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 2333response.StatusCode = int.Parse(statusString, CultureInfo.InvariantCulture); 3549response.StatusCode = StatusCodes.Status304NotModified;
InProcessWebSite (8)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (8)
321ctx.Response.StatusCode = 500; 332ctx.Response.StatusCode = 404; 334ctx.Response.StatusCode = 200; 357ctx.Response.StatusCode = 500; 379ctx.Response.StatusCode = 500; 525ctx.Response.StatusCode = 200; 1172ctx.Response.StatusCode = 500; 1193ctx.Response.StatusCode = 500;
LocalizationSample (2)
Startup.cs (2)
37context.Response.StatusCode = 404; 41context.Response.StatusCode = 200;
Microsoft.AspNetCore.Authentication (2)
AuthenticationHandler.cs (2)
288Response.StatusCode = 403; 301Response.StatusCode = 401;
Microsoft.AspNetCore.Authentication.Cookies (2)
CookieAuthenticationEvents.cs (2)
47context.Response.StatusCode = 401; 64context.Response.StatusCode = 403;
Microsoft.AspNetCore.Authentication.JwtBearer (2)
JwtBearerHandler.cs (2)
296Response.StatusCode = 401; 363Response.StatusCode = 403;
Microsoft.AspNetCore.Authentication.Negotiate (3)
NegotiateHandler.cs (3)
167Context.Response.StatusCode = StatusCodes.Status400BadRequest; 182Response.StatusCode = StatusCodes.Status401Unauthorized; 394Response.StatusCode = StatusCodes.Status401Unauthorized;
Microsoft.AspNetCore.Authentication.Negotiate.Test (6)
EventTests.cs (6)
55context.Response.StatusCode = StatusCodes.Status418ImATeapot; 103context.Response.StatusCode = StatusCodes.Status418ImATeapot; 153context.Response.StatusCode = StatusCodes.Status418ImATeapot; 203context.Response.StatusCode = StatusCodes.Status418ImATeapot; 253context.Response.StatusCode = StatusCodes.Status418ImATeapot; 452context.Response.StatusCode = StatusCodes.Status418ImATeapot;
Microsoft.AspNetCore.Authentication.Test (78)
AuthenticationMiddlewareTests.cs (1)
267_context.Response.StatusCode = _code;
CertificateTests.cs (1)
827response.StatusCode = (int)HttpStatusCode.OK;
CookieTests.cs (2)
1822res.StatusCode = 200; 1888res.StatusCode = 200;
GoogleTests.cs (1)
1202res.StatusCode = 401;
JwtBearerTests.cs (9)
184context.Response.StatusCode = 401; 208context.Response.StatusCode = 401; 595context.Response.StatusCode = StatusCodes.Status202Accepted; 666context.Response.StatusCode = StatusCodes.Status202Accepted; 742context.Response.StatusCode = StatusCodes.Status202Accepted; 853context.Response.StatusCode = 418; 878context.Response.StatusCode = 418; 1189context.Response.StatusCode = 401; 1198context.Response.StatusCode = 500;
JwtBearerTests_Handler.cs (9)
174context.Response.StatusCode = 401; 195context.Response.StatusCode = 401; 556context.Response.StatusCode = StatusCodes.Status202Accepted; 624context.Response.StatusCode = StatusCodes.Status202Accepted; 694context.Response.StatusCode = StatusCodes.Status202Accepted; 799context.Response.StatusCode = 418; 823context.Response.StatusCode = 418; 1248context.Response.StatusCode = 401; 1257context.Response.StatusCode = 500;
OAuthTests.cs (3)
337context.Response.StatusCode = StatusCodes.Status406NotAcceptable; 373context.Response.StatusCode = StatusCodes.Status406NotAcceptable; 409context.Response.StatusCode = StatusCodes.Status406NotAcceptable;
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
376context.Response.StatusCode = 410;
OpenIdConnect\OpenIdConnectEventTests.cs (22)
86context.Response.StatusCode = StatusCodes.Status202Accepted; 157context.Response.StatusCode = StatusCodes.Status202Accepted; 182context.Response.StatusCode = StatusCodes.Status202Accepted; 193context.Response.StatusCode = StatusCodes.Status202Accepted; 267context.Response.StatusCode = StatusCodes.Status202Accepted; 297context.Response.StatusCode = StatusCodes.Status202Accepted; 374context.Response.StatusCode = StatusCodes.Status202Accepted; 405context.Response.StatusCode = StatusCodes.Status202Accepted; 482context.Response.StatusCode = StatusCodes.Status202Accepted; 513context.Response.StatusCode = StatusCodes.Status202Accepted; 593context.Response.StatusCode = StatusCodes.Status202Accepted; 625context.Response.StatusCode = StatusCodes.Status202Accepted; 723context.Response.StatusCode = StatusCodes.Status202Accepted; 771context.Response.StatusCode = StatusCodes.Status202Accepted; 817context.Response.StatusCode = StatusCodes.Status202Accepted; 888context.Response.StatusCode = StatusCodes.Status202Accepted; 941context.Response.StatusCode = StatusCodes.Status202Accepted; 983context.Response.StatusCode = StatusCodes.Status202Accepted; 1030context.Response.StatusCode = StatusCodes.Status202Accepted; 1058context.Response.StatusCode = StatusCodes.Status202Accepted; 1096context.Response.StatusCode = StatusCodes.Status202Accepted; 1125context.Response.StatusCode = StatusCodes.Status202Accepted;
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (22)
86context.Response.StatusCode = StatusCodes.Status202Accepted; 157context.Response.StatusCode = StatusCodes.Status202Accepted; 182context.Response.StatusCode = StatusCodes.Status202Accepted; 193context.Response.StatusCode = StatusCodes.Status202Accepted; 267context.Response.StatusCode = StatusCodes.Status202Accepted; 297context.Response.StatusCode = StatusCodes.Status202Accepted; 374context.Response.StatusCode = StatusCodes.Status202Accepted; 405context.Response.StatusCode = StatusCodes.Status202Accepted; 482context.Response.StatusCode = StatusCodes.Status202Accepted; 513context.Response.StatusCode = StatusCodes.Status202Accepted; 593context.Response.StatusCode = StatusCodes.Status202Accepted; 625context.Response.StatusCode = StatusCodes.Status202Accepted; 723context.Response.StatusCode = StatusCodes.Status202Accepted; 771context.Response.StatusCode = StatusCodes.Status202Accepted; 817context.Response.StatusCode = StatusCodes.Status202Accepted; 888context.Response.StatusCode = StatusCodes.Status202Accepted; 941context.Response.StatusCode = StatusCodes.Status202Accepted; 983context.Response.StatusCode = StatusCodes.Status202Accepted; 1030context.Response.StatusCode = StatusCodes.Status202Accepted; 1058context.Response.StatusCode = StatusCodes.Status202Accepted; 1096context.Response.StatusCode = StatusCodes.Status202Accepted; 1125context.Response.StatusCode = StatusCodes.Status202Accepted;
OpenIdConnect\TestServerBuilder.cs (1)
85res.StatusCode = 401;
TestExtensions.cs (2)
47res.StatusCode = 200; 66res.StatusCode = 200;
TwitterTests.cs (2)
244context.Response.StatusCode = StatusCodes.Status406NotAcceptable; 350context.Response.StatusCode = StatusCodes.Status406NotAcceptable;
WsFederation\WsFederationTest.cs (1)
432context.Response.StatusCode = 500;
WsFederation\WsFederationTest_Handler.cs (1)
428context.Response.StatusCode = 500;
Microsoft.AspNetCore.Authorization.Test (1)
AuthorizationMiddlewareTests.cs (1)
1081context.Response.StatusCode = _statusCode;
Microsoft.AspNetCore.Components.Endpoints (7)
Builder\OpaqueRedirection.cs (2)
70httpContext.Response.StatusCode = 400; 88httpContext.Response.StatusCode = 400;
RazorComponentEndpointInvoker.cs (3)
176context.Response.StatusCode = StatusCodes.Status400BadRequest; 223context.Response.StatusCode = StatusCodes.Status400BadRequest; 249context.Response.StatusCode = StatusCodes.Status400BadRequest;
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
70_httpContext.Response.StatusCode = 400;
Results\RazorComponentResultExecutor.cs (1)
31response.StatusCode = result.StatusCode.Value;
Microsoft.AspNetCore.Components.Server (3)
CircuitDisconnectMiddleware.cs (3)
36context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed; 43context.Response.StatusCode = StatusCodes.Status400BadRequest; 49context.Response.StatusCode = StatusCodes.Status200OK;
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
TargetPickerUi.cs (2)
125context.Response.StatusCode = 404; 197context.Response.StatusCode = 404;
WebAssemblyNetDebugProxyAppBuilderExtensions.cs (1)
63context.Response.StatusCode = (int)HttpStatusCode.NotFound;
Microsoft.AspNetCore.ConcurrencyLimiter (1)
ConcurrencyLimiterMiddleware.cs (1)
81context.Response.StatusCode = StatusCodes.Status503ServiceUnavailable;
Microsoft.AspNetCore.Cors (2)
Infrastructure\CorsMiddleware.cs (2)
125context.Response.StatusCode = StatusCodes.Status204NoContent; 183context.Response.StatusCode = StatusCodes.Status204NoContent;
Microsoft.AspNetCore.Cors.Test (1)
CorsMiddlewareTests.cs (1)
589context.Response.StatusCode = 500;
Microsoft.AspNetCore.Diagnostics (6)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (3)
127context.Response.StatusCode = StatusCodes.Status499ClientClosedRequest; 156context.Response.StatusCode = badHttpRequestException.StatusCode; 160context.Response.StatusCode = 500;
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
57Response.StatusCode = 500;
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
123context.Response.StatusCode = StatusCodes.Status499ClientClosedRequest; 168context.Response.StatusCode = _options.StatusCodeSelector?.Invoke(edi.SourceException) ?? DefaultStatusCode;
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (4)
DatabaseDeveloperPageExceptionFilter.cs (1)
105response.StatusCode = 500;
MigrationsEndPointMiddleware.cs (2)
78context.Response.StatusCode = (int)HttpStatusCode.NoContent; 133response.StatusCode = (int)HttpStatusCode.BadRequest;
Views\DatabaseErrorPage.Designer.cs (1)
43Response.StatusCode = 500;
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckMiddleware.cs (1)
59httpContext.Response.StatusCode = statusCode;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\AcceptanceTests.cs (1)
67context.Response.StatusCode = StatusCodes.Status400BadRequest;
Microsoft.AspNetCore.Diagnostics.Tests (23)
ExceptionHandlerMiddlewareTest.cs (1)
431c.Response.StatusCode = 404;
ExceptionHandlerTest.cs (14)
49context.Response.StatusCode = (int)expectedStatusCode; 343httpContext.Response.StatusCode = StatusCodes.Status404NotFound; 558httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError; 624httpContext.Response.StatusCode = StatusCodes.Status404NotFound; 749c.Response.StatusCode = 200; 805c.Response.StatusCode = 200; 859c.Response.StatusCode = 200; 911c.Response.StatusCode = 200; 960httpContext.Response.StatusCode = StatusCodes.Status404NotFound; 969c.Response.StatusCode = 200; 1012httpContext.Response.StatusCode = StatusCodes.Status404NotFound; 1067httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError; 1082httpContext.Response.StatusCode = StatusCodes.Status404NotFound; 1145httpContext.Response.StatusCode = StatusCodes.Status404NotFound;
StatusCodeMiddlewareTest.cs (8)
35httpContext.Response.StatusCode = expectedStatusCode; 97httpContext.Response.StatusCode = expectedStatusCode; 159httpContext.Response.StatusCode = expectedStatusCode; 215httpContext.Response.StatusCode = expectedStatusCode; 262c.Response.StatusCode = 404; 298c.Response.StatusCode = 404; 334c.Response.StatusCode = 400; 372c.Response.StatusCode = 400;
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\JsonRequestHelpers.cs (1)
91response.StatusCode = MapStatusCodeToHttpStatus(status.StatusCode);
Internal\JsonTranscodingServerCallContext.cs (1)
238HttpContext.Response.StatusCode = StatusCodes.Status200OK;
Microsoft.AspNetCore.HostFiltering (1)
HostFilteringMiddleware.cs (1)
68context.Response.StatusCode = 400;
Microsoft.AspNetCore.Hosting (1)
Internal\ErrorPageBuilder.cs (1)
30context.Response.StatusCode = 500;
Microsoft.AspNetCore.Http (2)
Builder\ApplicationBuilder.cs (1)
186context.Response.StatusCode = StatusCodes.Status404NotFound;
Timeouts\RequestTimeoutsMiddleware.cs (1)
122context.Response.StatusCode = selectedPolicy?.TimeoutStatusCode ?? StatusCodes.Status504GatewayTimeout;
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
MapPathMiddlewareTests.cs (1)
14context.Response.StatusCode = 200;
MapPredicateMiddlewareTests.cs (1)
16context.Response.StatusCode = 200;
Microsoft.AspNetCore.Http.Connections (24)
Internal\HttpConnectionContext.cs (4)
517nonClonedContext.Response.StatusCode = StatusCodes.Status409Conflict; 527nonClonedContext.Response.StatusCode = StatusCodes.Status404NotFound; 562context.Response.StatusCode = StatusCodes.Status204NoContent; 576context.Response.StatusCode = StatusCodes.Status204NoContent;
Internal\HttpConnectionDispatcher.cs (15)
97context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed; 116context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed; 463context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed; 479context.Response.StatusCode = StatusCodes.Status404NotFound; 497context.Response.StatusCode = StatusCodes.Status404NotFound; 506context.Response.StatusCode = StatusCodes.Status404NotFound; 523context.Response.StatusCode = StatusCodes.Status400BadRequest; 555context.Response.StatusCode = StatusCodes.Status400BadRequest; 566context.Response.StatusCode = StatusCodes.Status202Accepted; 575context.Response.StatusCode = StatusCodes.Status404NotFound; 590context.Response.StatusCode = StatusCodes.Status409Conflict; 596context.Response.StatusCode = StatusCodes.Status400BadRequest; 780context.Response.StatusCode = StatusCodes.Status400BadRequest; 790context.Response.StatusCode = StatusCodes.Status404NotFound; 814context.Response.StatusCode = StatusCodes.Status404NotFound;
Internal\Transports\LongPollingServerTransport.cs (5)
45context.Response.StatusCode = StatusCodes.Status204NoContent; 88context.Response.StatusCode = StatusCodes.Status200OK; 94context.Response.StatusCode = StatusCodes.Status204NoContent; 102context.Response.StatusCode = StatusCodes.Status204NoContent; 109context.Response.StatusCode = StatusCodes.Status500InternalServerError;
Microsoft.AspNetCore.Http.Extensions (13)
RequestDelegateFactory.cs (10)
1390httpContext.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType; 1400httpContext.Response.StatusCode = ex.StatusCode; 1406httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 1412httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 1507httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 1514httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 1521httpContext.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType; 1532httpContext.Response.StatusCode = ex.StatusCode; 1538httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 1544httpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
ResponseExtensions.cs (3)
26response.StatusCode = 200; 46response.StatusCode = permanent ? StatusCodes.Status308PermanentRedirect : StatusCodes.Status307TemporaryRedirect; 50response.StatusCode = permanent ? StatusCodes.Status301MovedPermanently : StatusCodes.Status302Found;
Microsoft.AspNetCore.Http.Extensions.Tests (13)
HttpResponseJsonExtensionsTests.cs (2)
99context.Response.StatusCode = StatusCodes.Status418ImATeapot; 251context.Response.StatusCode = StatusCodes.Status418ImATeapot;
ProblemDetailsDefaultWriterTest.cs (1)
680Response = { Body = body, StatusCode = statusCode },
ProblemDetailsServiceTest.cs (6)
26Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 52Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 71Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 87Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 102Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 122Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
RequestDelegateFactoryTests.cs (1)
2403c.Response.StatusCode = 400;
RequestDelegateGenerator\SharedTypes.cs (1)
977httpContext.Response.StatusCode = StatusCodes.Status410Gone;
ResponseExtensionTests.cs (2)
14context.Response.StatusCode = 201; 43context.Response.StatusCode = StatusCodes.Status200OK;
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
977httpContext.Response.StatusCode = StatusCodes.Status410Gone;
Microsoft.AspNetCore.Http.Results (34)
Accepted.cs (1)
73httpContext.Response.StatusCode = StatusCode;
AcceptedAtRoute.cs (1)
100httpContext.Response.StatusCode = StatusCode;
AcceptedAtRouteOfT.cs (1)
114httpContext.Response.StatusCode = StatusCode;
AcceptedOfT.cs (1)
89httpContext.Response.StatusCode = StatusCode;
BadRequest.cs (1)
43httpContext.Response.StatusCode = StatusCode;
BadRequestOfT.cs (1)
54httpContext.Response.StatusCode = StatusCode;
Conflict.cs (1)
43httpContext.Response.StatusCode = StatusCode;
ConflictOfT.cs (1)
54httpContext.Response.StatusCode = StatusCode;
ContentHttpResult.cs (1)
69httpContext.Response.StatusCode = statusCode;
Created.cs (1)
73httpContext.Response.StatusCode = StatusCode;
CreatedAtRoute.cs (1)
100httpContext.Response.StatusCode = StatusCode;
CreatedAtRouteOfT.cs (1)
114httpContext.Response.StatusCode = StatusCode;
CreatedOfT.cs (1)
88httpContext.Response.StatusCode = StatusCode;
InternalServerError.cs (1)
43httpContext.Response.StatusCode = StatusCode;
InternalServerErrorOfT.cs (1)
54httpContext.Response.StatusCode = StatusCode;
JsonHttpResultOfT.cs (1)
100httpContext.Response.StatusCode = statusCode;
NoContent.cs (1)
43httpContext.Response.StatusCode = StatusCode;
NotFound.cs (1)
42httpContext.Response.StatusCode = StatusCode;
NotFoundOfT.cs (1)
53httpContext.Response.StatusCode = StatusCode;
Ok.cs (1)
42httpContext.Response.StatusCode = StatusCode;
OkOfT.cs (1)
53httpContext.Response.StatusCode = StatusCode;
ProblemHttpResult.cs (1)
60httpContext.Response.StatusCode = code;
RedirectHttpResult.cs (1)
111httpContext.Response.StatusCode = Permanent
RedirectToRouteHttpResult.cs (1)
181httpContext.Response.StatusCode = Permanent ?
src\Shared\ResultsHelpers\FileResultHelper.cs (4)
117response.StatusCode = StatusCodes.Status304NotModified; 122response.StatusCode = StatusCodes.Status412PreconditionFailed; 315response.StatusCode = StatusCodes.Status416RangeNotSatisfiable; 322response.StatusCode = StatusCodes.Status206PartialContent;
StatusCodeHttpResult.cs (1)
46httpContext.Response.StatusCode = StatusCode;
UnauthorizedHttpResult.cs (1)
39httpContext.Response.StatusCode = StatusCode;
UnprocessableEntity.cs (1)
43httpContext.Response.StatusCode = StatusCode;
UnprocessableEntityOfT.cs (1)
54httpContext.Response.StatusCode = StatusCode;
Utf8ContentHttpResult.cs (1)
62httpContext.Response.StatusCode = statusCode;
ValidationProblem.cs (1)
61httpContext.Response.StatusCode = StatusCode;
Microsoft.AspNetCore.Http.Tests (2)
ApplicationBuilderTests.cs (2)
34httpContext.Response.StatusCode = 200; 115context.Response.StatusCode = StatusCodes.Status204NoContent;
Microsoft.AspNetCore.HttpLogging.Tests (28)
HttpLoggingMiddlewareTests.cs (16)
819c.Response.StatusCode = 200; 842c.Response.StatusCode = 200; 866c.Response.StatusCode = 200; 888c.Response.StatusCode = 200; 912c.Response.StatusCode = 200; 938c.Response.StatusCode = 200; 962c.Response.StatusCode = 200; 1096c.Response.StatusCode = 200; 1134c.Response.StatusCode = 200; 1211httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1261httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1315httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1358httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1402c.Response.StatusCode = 200; 1436httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 2000context.Response.StatusCode = StatusCodes.Status418ImATeapot;
W3CLoggingMiddlewareTests.cs (12)
48c.Response.StatusCode = 200; 75c.Response.StatusCode = 200; 84httpContext.Response.StatusCode = 200; 117c.Response.StatusCode = 200; 129httpContext.Response.StatusCode = 200; 161c.Response.StatusCode = 200; 170httpContext.Response.StatusCode = 200; 192c.Response.StatusCode = 200; 202httpContext.Response.StatusCode = 200; 237c.Response.StatusCode = 200; 249httpContext.Response.StatusCode = 200; 281c.Response.StatusCode = 200;
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionMiddleware.cs (1)
109context.Response.StatusCode = _statusCode;
Microsoft.AspNetCore.Identity.InMemory.Test (9)
FunctionalTest.cs (9)
308res.StatusCode = 200; 322res.StatusCode = result.Succeeded ? 200 : 500; 327res.StatusCode = result.Succeeded ? 200 : 500; 333res.StatusCode = result.Succeeded ? 200 : 500; 339res.StatusCode = result.Succeeded ? 200 : 500; 345res.StatusCode = 200; 351res.StatusCode = result ? 200 : 500; 356res.StatusCode = result.Succeeded ? 200 : 500; 407res.StatusCode = 200;
Microsoft.AspNetCore.Mvc.Core (16)
Formatters\HttpNoContentOutputFormatter.cs (1)
40response.StatusCode = StatusCodes.Status204NoContent;
Formatters\TextOutputFormatter.cs (1)
131context.HttpContext.Response.StatusCode = statusCode;
Infrastructure\ContentResultExecutor.cs (1)
53response.StatusCode = result.StatusCode.Value;
Infrastructure\LocalRedirectResultExecutor.cs (1)
54context.HttpContext.Response.StatusCode = result.Permanent ?
Infrastructure\ObjectResultExecutor.cs (1)
102context.HttpContext.Response.StatusCode = statusCode;
Infrastructure\RedirectResultExecutor.cs (1)
51context.HttpContext.Response.StatusCode = result.Permanent ?
Infrastructure\RedirectToActionResultExecutor.cs (1)
57context.HttpContext.Response.StatusCode = result.Permanent ?
Infrastructure\RedirectToPageResultExecutor.cs (1)
57context.HttpContext.Response.StatusCode = result.Permanent ?
Infrastructure\RedirectToRouteResultExecutor.cs (1)
53context.HttpContext.Response.StatusCode = result.Permanent ?
Infrastructure\SystemTextJsonResultExecutor.cs (1)
55response.StatusCode = result.StatusCode.Value;
ObjectResult.cs (1)
87context.HttpContext.Response.StatusCode = StatusCode.Value;
src\Shared\ResultsHelpers\FileResultHelper.cs (4)
117response.StatusCode = StatusCodes.Status304NotModified; 122response.StatusCode = StatusCodes.Status412PreconditionFailed; 315response.StatusCode = StatusCodes.Status416RangeNotSatisfiable; 322response.StatusCode = StatusCodes.Status206PartialContent;
StatusCodeResult.cs (1)
43httpContext.Response.StatusCode = StatusCode;
Microsoft.AspNetCore.Mvc.Core.Test (4)
Filters\MiddlewareFilterTest.cs (2)
179httpContext.Response.StatusCode = 500; 499context.HttpContext.Response.StatusCode = 200;
Formatters\NoContentFormatterTests.cs (1)
158httpContext.Response.StatusCode = StatusCodes.Status201Created;
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
207Response = { Body = body, StatusCode = statusCode },
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonResultExecutor.cs (1)
89response.StatusCode = result.StatusCode.Value;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponentResultExecutor.cs (1)
98response.StatusCode = result.StatusCode.Value;
ViewExecutor.cs (1)
201response.StatusCode = statusCode.Value;
Microsoft.AspNetCore.OpenApi (1)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (1)
40context.Response.StatusCode = StatusCodes.Status404NotFound;
Microsoft.AspNetCore.OutputCaching.Tests (5)
OutputCachePolicyProviderTests.cs (5)
246context.HttpContext.Response.StatusCode = statusCode; 322context.HttpContext.Response.StatusCode = statusCode; 336context.HttpContext.Response.StatusCode = StatusCodes.Status200OK; 356context.HttpContext.Response.StatusCode = StatusCodes.Status200OK; 379context.HttpContext.Response.StatusCode = StatusCodes.Status200OK;
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
33context.Response.StatusCode = 201;
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
123context.Response.StatusCode = _rejectionStatusCode;
Microsoft.AspNetCore.RateLimiting.Tests (14)
RateLimitingMiddlewareTests.cs (13)
119context.HttpContext.Response.StatusCode = 429; 198context.HttpContext.Response.StatusCode = 429; 234context.HttpContext.Response.StatusCode = 429; 265context.HttpContext.Response.StatusCode = 429; 297context.HttpContext.Response.StatusCode = 429; 329context.HttpContext.Response.StatusCode = 429; 361context.HttpContext.Response.StatusCode = 429; 392context.HttpContext.Response.StatusCode = 429; 438context.HttpContext.Response.StatusCode = 429; 490context.HttpContext.Response.StatusCode = 429; 528context.HttpContext.Response.StatusCode = 429; 564context.HttpContext.Response.StatusCode = 429; 598context.HttpContext.Response.StatusCode = 429;
TestRateLimiterPolicy.cs (1)
21context.HttpContext.Response.StatusCode = statusCode;
Microsoft.AspNetCore.ResponseCaching (3)
ResponseCachingMiddleware.cs (3)
155context.HttpContext.Response.StatusCode = StatusCodes.Status304NotModified; 172response.StatusCode = context.CachedResponse.StatusCode; 233context.HttpContext.Response.StatusCode = StatusCodes.Status504GatewayTimeout;
Microsoft.AspNetCore.Rewrite (7)
RedirectRule.cs (1)
48response.StatusCode = StatusCode;
RedirectToHttpsRule.cs (1)
35response.StatusCode = StatusCode;
RedirectToWwwHelper.cs (1)
54response.StatusCode = statusCode;
UrlActions\CustomResponseAction.cs (1)
25response.StatusCode = StatusCode;
UrlActions\ForbiddenAction.cs (1)
12context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
UrlActions\GoneAction.cs (1)
12context.HttpContext.Response.StatusCode = StatusCodes.Status410Gone;
UrlActions\RedirectAction.cs (1)
50response.StatusCode = StatusCode;
Microsoft.AspNetCore.Routing (4)
EndpointRoutingMiddleware.cs (1)
183httpContext.Response.StatusCode = shortCircuitMetadata.StatusCode.Value;
Matching\AcceptsMatcherPolicy.cs (1)
253context.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType;
Matching\HttpMethodMatcherPolicy.cs (1)
389context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed;
Matching\NegotiationMatcherPolicy.cs (1)
323context.Response.StatusCode = StatusCodes.Status406NotAcceptable;
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
197httpContext.Response.StatusCode = 400;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (17)
AuthenticationTests.cs (3)
74httpContext.Response.StatusCode = 401; 100httpContext.Response.StatusCode = 401; 126httpContext.Response.StatusCode = 401;
DelegateTests.cs (2)
73httpContext.Response.StatusCode = StatusCodes.Status418ImATeapot; 139httpContext.Response.StatusCode = StatusCodes.Status418ImATeapot;
OpaqueUpgradeTests.cs (1)
61httpContext.Response.StatusCode = StatusCodes.Status500InternalServerError;
RequestBodyTests.cs (1)
284httpContext.Response.StatusCode = 200;
ResponseCachingTests.cs (2)
111httpContext.Response.StatusCode = StatusCodes.Status304NotModified; 432httpContext.Response.StatusCode = status;
ResponseHeaderTests.cs (2)
228Assert.Throws<InvalidOperationException>(() => response.StatusCode = 404); 259Assert.Throws<InvalidOperationException>(() => response.StatusCode = 404);
ResponseTests.cs (6)
47httpContext.Response.StatusCode = 201; 66httpContext.Response.StatusCode = 201; 86httpContext.Response.StatusCode = 901; 103httpContext.Response.StatusCode = 100; 118httpContext.Response.StatusCode = 0; 241httpContext.Response.StatusCode = 400;
Microsoft.AspNetCore.Server.IIS (2)
Core\IISServerAuthenticationHandlerInternal.cs (2)
44_context.Response.StatusCode = 401; 53_context.Response.StatusCode = 403;
Microsoft.AspNetCore.Server.IISIntegration (4)
AuthenticationHandler.cs (2)
36_context.Response.StatusCode = 401; 44_context.Response.StatusCode = 403;
IISMiddleware.cs (2)
106httpContext.Response.StatusCode = StatusCodes.Status400BadRequest; 117httpContext.Response.StatusCode = StatusCodes.Status202Accepted;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (8)
HeaderCollectionBenchmark.cs (3)
126_response.StatusCode = 200; 148_response.StatusCode = 200; 188_response.StatusCode = 200;
InMemoryTransportBenchmark.cs (1)
262response.StatusCode = 200;
NamedPipesTransportBenchmark.cs (1)
160response.StatusCode = 200;
ResponseHeaderCollectionBenchmark.cs (3)
99_response.StatusCode = 200; 116_response.StatusCode = 200; 151_response.StatusCode = 200;
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\SpaProxy.cs (2)
167context.Response.StatusCode = (int)responseMessage.StatusCode; 256context.Response.StatusCode = 400;
Microsoft.AspNetCore.StaticAssets (3)
StaticAssetsInvoker.cs (3)
121context.Response.StatusCode = statusCode; 214requestContext.Response.StatusCode = StatusCodes.Status416RangeNotSatisfiable; 226requestContext.Response.StatusCode = StatusCodes.Status416RangeNotSatisfiable;
Microsoft.AspNetCore.StaticAssets.Tests (2)
StaticAssetsIntegrationTests.cs (2)
215context.Response.StatusCode = 400; 272context.Response.StatusCode = 400;
Microsoft.AspNetCore.StaticFiles (2)
Helpers.cs (1)
43context.Response.StatusCode = StatusCodes.Status301MovedPermanently;
StaticFileContext.cs (1)
248_response.StatusCode = statusCode;
Microsoft.AspNetCore.StaticFiles.Tests (3)
DirectoryBrowserMiddlewareTests.cs (1)
112c.Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
StaticFileMiddlewareTests.cs (2)
424context.Response.StatusCode = StatusCodes.Status200OK; 450context.Response.StatusCode = (int)errorCode;
Microsoft.AspNetCore.TestHost (1)
WebSocketClient.cs (1)
143_httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols;
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
3149context.Response.StatusCode = 418; // I'm a teapot 3168c.Response.StatusCode = 203;
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
79context.Response.StatusCode = StatusCodes.Status403Forbidden;
Microsoft.AspNetCore.WebSockets.Tests (1)
KestrelWebSocketHelpers.cs (1)
41ct.Response.StatusCode = 500;
OpenIdConnectSample (1)
Startup.cs (1)
128c.Response.StatusCode = 500;
OutputCachingSample (1)
Gravatar.cs (1)
12context.Response.StatusCode = 200;
PlaintextApp (1)
Startup.cs (1)
28response.StatusCode = 200;
RateLimitingSample (1)
SampleRateLimiterPolicy.cs (1)
17context.HttpContext.Response.StatusCode = 429;
RazorPagesWebSite (1)
CustomActionResult.cs (1)
12context.HttpContext.Response.StatusCode = 200;
RoutingSandbox (3)
HelloExtension\HelloMiddleware.cs (1)
34response.StatusCode = 200;
UseEndpointRoutingStartup.cs (2)
49response.StatusCode = 200; 59response.StatusCode = 200;
RoutingWebSite (8)
HelloExtension\HelloMiddleware.cs (1)
34response.StatusCode = 200;
UseEndpointRoutingStartup.cs (7)
51response.StatusCode = 200; 61response.StatusCode = 200; 81response.StatusCode = 200; 90response.StatusCode = 200; 101response.StatusCode = 200; 113response.StatusCode = 200; 142response.StatusCode = 200;
ServerComparison.TestSites (1)
StartupNtlmAuthentication.cs (1)
42context.Response.StatusCode = 500;
SignalR.Client.FunctionalTestApp (2)
Startup.cs (2)
145context.Response.StatusCode = StatusCodes.Status204NoContent; 207context.Response.StatusCode = 400;
SocialSample (1)
Startup.cs (1)
216context.Response.StatusCode = 500;
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (1)
360context.Response.StatusCode = StatusCodes.Status500InternalServerError;
StatusCodePagesSample (1)
Startup.cs (1)
38context.Response.StatusCode = int.Parse(requestedStatusCode, CultureInfo.InvariantCulture);
WebPubSubWeb (3)
Program.cs (3)
57context.Response.StatusCode = 200; 63context.Response.StatusCode = 400; 66context.Response.StatusCode = 200;
475 references to StatusCode
InMemory.FunctionalTests (1)
ResponseTests.cs (1)
4692disposedTcs.TrySetResult(c.Response.StatusCode);
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (2)
331Assert.Equal(200, ctx.Response.StatusCode); 333Assert.Equal(404, ctx.Response.StatusCode);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
422if (shouldRedirect && Response.StatusCode == 200)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
353if (Response.StatusCode == 403)
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
195if (Response.StatusCode < StatusCodes.Status400BadRequest)
Microsoft.AspNetCore.Authentication.Negotiate.Test (30)
EventTests.cs (14)
32Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 41Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 65Assert.Equal(StatusCodes.Status418ImATeapot, result.Response.StatusCode); 113Assert.Equal(StatusCodes.Status418ImATeapot, result.Response.StatusCode); 163Assert.Equal(StatusCodes.Status418ImATeapot, result.Response.StatusCode); 188Assert.Equal(StatusCodes.Status418ImATeapot, response.Response.StatusCode); 213Assert.Equal(StatusCodes.Status418ImATeapot, result.Response.StatusCode); 238Assert.Equal(StatusCodes.Status400BadRequest, response.Response.StatusCode); 263Assert.Equal(StatusCodes.Status418ImATeapot, result.Response.StatusCode); 293Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 339Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 363Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 398Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 405Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode);
NegotiateHandlerTests.cs (16)
40Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 50Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 60Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 72Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 82Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 164Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 191Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 289Assert.Equal(StatusCodes.Status500InternalServerError, result.Response.StatusCode); 300Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 311Assert.Equal(StatusCodes.Status400BadRequest, result.Response.StatusCode); 328Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 336Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 349Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 356Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode); 369Assert.Equal(StatusCodes.Status401Unauthorized, result.Response.StatusCode); 376Assert.Equal(StatusCodes.Status200OK, result.Response.StatusCode);
Microsoft.AspNetCore.Components.Endpoints.Tests (7)
EndpointHtmlRendererTest.cs (4)
807Assert.Equal(302, ctx.Response.StatusCode); 902Assert.Equal(400, httpContext.Response.StatusCode); 931Assert.Equal(400, httpContext.Response.StatusCode); 1042Assert.Equal(400, httpContext.Response.StatusCode);
RazorComponentEndpointInvokerTest.cs (1)
51Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode);
RazorComponentResultTest.cs (2)
66Assert.Equal(200, httpContext.Response.StatusCode); 88Assert.Equal(123, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Components.Server.Tests (7)
CircuitDisconnectMiddlewareTest.cs (7)
41Assert.Equal(StatusCodes.Status405MethodNotAllowed, context.Response.StatusCode); 70Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 97Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 129Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 162Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 199Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 237Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
MiddlewareTests.cs (2)
45Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 165Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode);
Microsoft.AspNetCore.Cors.Test (2)
CorsMiddlewareTests.cs (2)
427Assert.Equal(200, httpContext.Response.StatusCode); 765Assert.Equal(StatusCodes.Status204NoContent, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Diagnostics (10)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
257Status = httpContext.Response.StatusCode
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
195ProblemDetails = { Status = context.Response.StatusCode }, 205if (context.Response.HasStarted || handled || _options.StatusCodeSelector != null || context.Response.StatusCode != StatusCodes.Status404NotFound || _options.AllowStatusCode404Response)
StatusCodePage\StatusCodePagesExtensions.cs (4)
78var body = string.Format(CultureInfo.InvariantCulture, bodyFormat, context.HttpContext.Response.StatusCode); 101var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.HttpContext.Response.StatusCode); 110var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.HttpContext.Response.StatusCode); 167var originalStatusCode = context.HttpContext.Response.StatusCode;
StatusCodePage\StatusCodePagesMiddleware.cs (2)
68|| context.Response.StatusCode < 400 69|| context.Response.StatusCode >= 600
StatusCodePage\StatusCodePagesOptions.cs (1)
25var statusCode = context.HttpContext.Response.StatusCode;
Microsoft.AspNetCore.Diagnostics.Abstractions (1)
IStatusCodeReExecuteFeature.cs (1)
32/// The <see cref="HttpResponse.StatusCode"/> of the original response.
Microsoft.AspNetCore.Diagnostics.Tests (2)
StatusCodeMiddlewareTest.cs (2)
338endpoints.MapGet("/status", (HttpResponse response) => $"Status: {response.StatusCode}"); 376endpoints.MapGet("/status", (HttpResponse response) => $"Status: {response.StatusCode}");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (17)
ServerStreamingServerCallHandlerTests.cs (2)
63Assert.Equal(200, httpContext.Response.StatusCode); 244Assert.Equal(200, httpContext.Response.StatusCode);
UnaryServerCallHandlerTests.cs (15)
73Assert.Equal(200, httpContext.Response.StatusCode); 745Assert.Equal(400, httpContext.Response.StatusCode); 783Assert.Equal(400, httpContext.Response.StatusCode); 812Assert.Equal(400, httpContext.Response.StatusCode); 837Assert.Equal(401, httpContext.Response.StatusCode); 862Assert.Equal(401, httpContext.Response.StatusCode); 929Assert.Equal(400, httpContext.Response.StatusCode); 1007Assert.Equal(500, httpContext.Response.StatusCode); 1049Assert.Equal(500, httpContext.Response.StatusCode); 1079Assert.Equal(500, httpContext.Response.StatusCode); 1108Assert.Equal(401, httpContext.Response.StatusCode); 1150Assert.Equal(200, httpContext.Response.StatusCode); 1204Assert.Equal(200, httpContext.Response.StatusCode); 1363Assert.Equal(200, httpContext.Response.StatusCode); 1471Assert.Equal(500, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Hosting (11)
Internal\HostingApplicationDiagnostics.cs (5)
169httpContext.Response.StatusCode, 232if (httpContext.Response.StatusCode >= 500) 338[DynamicDependency(nameof(HttpResponse.StatusCode), typeof(HttpResponse))] 359[DynamicDependency(nameof(HttpResponse.StatusCode), typeof(HttpResponse))] 467[DynamicDependency(nameof(HttpResponse.StatusCode), typeof(HttpResponse))]
Internal\HostingRequestFinishedLog.cs (3)
361 => new KeyValuePair<string, object?>(nameof(response.StatusCode), response.StatusCode), 66_cachedToString = $"Request finished {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {response.StatusCode.ToString(CultureInfo.InvariantCulture)} {ValueOrEmptyMarker(response.ContentLength)} {EscapedValueOrEmptyMarker(response.ContentType)} {Elapsed.TotalMilliseconds.ToString("0.0000", CultureInfo.InvariantCulture)}ms";
Internal\HostingRequestUnhandledLog.cs (3)
285 => new KeyValuePair<string, object?>(nameof(_httpContext.Response.StatusCode), _httpContext.Response.StatusCode), 44_cachedToString = $"Request reached the end of the middleware pipeline without being handled by application code. Request path: {request.Method} {request.Scheme}://{request.Host}{request.PathBase}{request.Path}, Response status code: {response.StatusCode}";
Microsoft.AspNetCore.Http (3)
DefaultHttpContext.cs (1)
247return HttpContextDebugFormatter.ContextToString(this, ReasonPhrases.GetReasonPhrase(Response.StatusCode));
src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
16sb.Append(response.StatusCode); 73sb.Append(context.Response.StatusCode);
Microsoft.AspNetCore.Http.Abstractions.Tests (13)
MapPathMiddlewareTests.cs (9)
62Assert.Equal(200, context.Response.StatusCode); 92Assert.Equal(200, context.Response.StatusCode); 120Assert.Equal(200, context.Response.StatusCode); 151Assert.Equal(200, context.Response.StatusCode); 173Assert.Equal(200, context.Response.StatusCode); 195Assert.Equal(200, context.Response.StatusCode); 201Assert.Equal(404, context.Response.StatusCode); 207Assert.Equal(200, context.Response.StatusCode); 213Assert.Equal(200, context.Response.StatusCode);
MapPredicateMiddlewareTests.cs (4)
68Assert.Equal(200, context.Response.StatusCode); 80Assert.Equal(200, context.Response.StatusCode); 93Assert.Equal(200, context.Response.StatusCode); 110Assert.Equal(200, context.Response.StatusCode);
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
272if (context.Response.StatusCode == StatusCodes.Status204NoContent)
Microsoft.AspNetCore.Http.Connections.Tests (46)
HttpConnectionDispatcherTests.cs (42)
320Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 361Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 399Assert.Equal(StatusCodes.Status405MethodNotAllowed, context.Response.StatusCode); 438Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 791Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 869Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 915Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 943Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 1017Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1049Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1076Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1080Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1112Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1116Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1148Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1155Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1201Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1457Assert.Equal(StatusCodes.Status409Conflict, context2.Response.StatusCode); 1515Assert.Equal(StatusCodes.Status204NoContent, context1.Response.StatusCode); 1581Assert.Equal(StatusCodes.Status409Conflict, context1.Response.StatusCode); 1587Assert.Equal(StatusCodes.Status409Conflict, context2.Response.StatusCode); 1625Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 1665Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1697Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1726Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1738Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1780Assert.Equal(StatusCodes.Status204NoContent, context1.Response.StatusCode); 1783Assert.Equal(StatusCodes.Status200OK, context2.Response.StatusCode); 1859Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1871Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1911Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1923Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 2043Assert.Equal(StatusCodes.Status400BadRequest, deleteContext.Response.StatusCode); 2092Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2134Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2196Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2503Assert.Equal(409, context.Response.StatusCode); 2595Assert.Equal(404, context.Response.StatusCode); 2652Assert.Equal(404, context.Response.StatusCode); 2750Assert.Equal(StatusCodes.Status500InternalServerError, pollContext.Response.StatusCode); 2802Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 3713Assert.Equal(status, context.Response.StatusCode);
LongPollingTests.cs (4)
36Assert.Equal(204, context.Response.StatusCode); 57Assert.Equal(200, context.Response.StatusCode); 80Assert.Equal(200, context.Response.StatusCode); 106Assert.Equal(200, context.Response.StatusCode);
Microsoft.AspNetCore.Http.Extensions (3)
DefaultProblemDetailsWriter.cs (1)
56ProblemDetailsDefaults.Apply(context.ProblemDetails, httpContext.Response.StatusCode);
RequestDelegateFactory.cs (2)
103private static readonly MemberExpression StatusCodeExpr = Expression.Property(HttpResponseExpr, typeof(HttpResponse).GetProperty(nameof(HttpResponse.StatusCode))!); 118private static readonly MemberExpression FilterContextHttpContextStatusCodeExpr = Expression.Property(FilterContextHttpContextResponseExpr, typeof(HttpResponse).GetProperty(nameof(HttpResponse.StatusCode))!);
Microsoft.AspNetCore.Http.Extensions.Tests (83)
HttpResponseJsonExtensionsTests.cs (10)
33Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 104Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 174Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 256Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 272Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 297Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 325Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 359Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 393Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 427Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
RequestDelegateFactoryTests.cs (22)
767Assert.Equal(200, httpContext.Response.StatusCode); 896Assert.Equal(400, httpContext.Response.StatusCode); 1580Assert.Equal(400, httpContext.Response.StatusCode); 1589Assert.Equal(200, httpContext.Response.StatusCode); 1679Assert.Equal(400, httpContext.Response.StatusCode); 1695Assert.Equal(200, httpContext.Response.StatusCode); 1754Assert.Equal(200, httpContext.Response.StatusCode); 1788Assert.Equal(200, httpContext.Response.StatusCode); 1818Assert.Equal(200, httpContext.Response.StatusCode); 1848Assert.Equal(200, httpContext.Response.StatusCode); 1875Assert.Equal(200, httpContext.Response.StatusCode); 1915Assert.Equal(200, httpContext.Response.StatusCode); 1951Assert.Equal(413, httpContext.Response.StatusCode); 1984Assert.Equal(413, httpContext.Response.StatusCode); 2180Assert.Equal(200, httpContext.Response.StatusCode); 2223Assert.Equal(200, httpContext.Response.StatusCode); 2294Assert.Equal(200, httpContext.Response.StatusCode); 2389Assert.Equal(200, httpContext.Response.StatusCode); 2426Assert.Equal(400, httpContext.Response.StatusCode); 2508Assert.Equal(200, httpContext.Response.StatusCode); 3152Assert.Equal(200, httpContext.Response.StatusCode); 3199Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateFactoryTests.FormMapping.cs (2)
201Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode); 234Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
RequestDelegateGenerator\CompileTimeCreationTests.cs (3)
386Assert.Equal(400, httpContext.Response.StatusCode); 561Assert.Equal(400, httpContext1.Response.StatusCode); 569Assert.Equal(400, httpContext2.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
248Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 258Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 265Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (1)
387Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (5)
61Assert.Equal(200, httpContext.Response.StatusCode); 82Assert.Equal(200, httpContext.Response.StatusCode); 111Assert.Equal(200, httpContext.Response.StatusCode); 140Assert.Equal(400, httpContext.Response.StatusCode); 141Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.cs (6)
440Assert.Equal(200, httpContext.Response.StatusCode); 466Assert.Equal(200, httpContext.Response.StatusCode); 488Assert.Equal(400, httpContext.Response.StatusCode); 513Assert.Equal(200, httpContext.Response.StatusCode); 538Assert.Equal(200, httpContext.Response.StatusCode); 563Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (5)
343Assert.Equal(415, httpContext.Response.StatusCode); 376Assert.Equal(400, httpContext.Response.StatusCode); 880Assert.Equal(400, httpContext.Response.StatusCode); 971Assert.Equal(400, httpContext.Response.StatusCode); 1010Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (3)
143Assert.Equal(400, httpContext.Response.StatusCode); 473Assert.Equal(400, httpContext.Response.StatusCode); 481Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
130Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (1)
145Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (14)
42Assert.Equal(400, httpContext.Response.StatusCode); 105Assert.Equal(400, httpContext.Response.StatusCode); 158Assert.Equal(200, httpContext.Response.StatusCode); 195Assert.Equal(200, httpContext.Response.StatusCode); 226Assert.Equal(400, httpContext.Response.StatusCode); 275Assert.Equal(200, httpContext.Response.StatusCode); 306Assert.Equal(400, httpContext.Response.StatusCode); 354Assert.Equal(200, httpContext.Response.StatusCode); 400Assert.Equal(415, httpContext.Response.StatusCode); 449Assert.Equal(415, httpContext.Response.StatusCode); 526Assert.Equal(400, httpContext.Response.StatusCode); 568Assert.Equal(200, httpContext.Response.StatusCode); 606Assert.Equal(400, httpContext.Response.StatusCode); 647Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (2)
66Assert.Equal(400, httpContext.Response.StatusCode); 76Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.RouteParameter.cs (1)
208Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (1)
82Assert.Equal(200, httpContext.Response.StatusCode);
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (1)
177Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
ResponseExtensionTests.cs (2)
20Assert.Equal(200, context.Response.StatusCode); 48Assert.Equal(expectedStatusCode, context.Response.StatusCode);
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
248Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 258Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 265Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Http.Results.Tests (84)
AcceptedAtRouteOfTResultTests.cs (1)
98Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
AcceptedAtRouteResultTests.cs (1)
52Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
AcceptedOfTResultTests.cs (1)
44Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
AcceptedResultTests.cs (1)
28Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
BadRequestOfTResultTests.cs (2)
59Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 102Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
BadRequestResultTests.cs (1)
42Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
ConflictOfTResultTests.cs (1)
58Assert.Equal(StatusCodes.Status409Conflict, httpContext.Response.StatusCode);
ConflictResultTests.cs (1)
43Assert.Equal(StatusCodes.Status409Conflict, httpContext.Response.StatusCode);
CreatedAtRouteOfTResultTests.cs (1)
68Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
CreatedAtRouteResultTests.cs (1)
51Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
CreatedOfTResultTests.cs (2)
57Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode); 74Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
CreatedResultTests.cs (2)
42Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode); 59Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
EmptyResultTests.cs (1)
22Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
InternalServerErrorOfTResultTests.cs (2)
59Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 102Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode);
InternalServerErrorResultTests.cs (1)
42Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode);
JsonResultTests.cs (7)
32Assert.Equal(411, httpContext.Response.StatusCode); 50Assert.Equal(407, httpContext.Response.StatusCode); 100Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode); 133Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 162Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 194Assert.Equal(StatusCodes.Status418ImATeapot, httpContext.Response.StatusCode); 240Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, httpContext.Response.StatusCode);
LocalRedirectResultTests.cs (1)
73Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode);
NoContentResultTests.cs (1)
39Assert.Equal(StatusCodes.Status204NoContent, httpContext.Response.StatusCode);
NotFoundOfTResultTests.cs (1)
62Assert.Equal(StatusCodes.Status404NotFound, httpContext.Response.StatusCode);
NotFoundResultTests.cs (1)
38Assert.Equal(StatusCodes.Status404NotFound, httpContext.Response.StatusCode);
OkOfTResultTests.cs (1)
79Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
OkResultTests.cs (1)
41Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
ProblemResultTests.cs (6)
36Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 68Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 97Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 129Assert.Equal(StatusCodes.Status418ImATeapot, httpContext.Response.StatusCode); 161Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 188Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, httpContext.Response.StatusCode);
RedirectToRouteResultTests.cs (2)
65Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 83Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
src\Shared\ResultsTests\FileContentResultTestBase.cs (8)
83Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 122Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 158Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 192Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 224Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 257Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 291Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 325Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (10)
62Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 103Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 141Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 178Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 212Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 247Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 283Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 319Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 363Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 437Assert.Equal(200, httpContext.Response.StatusCode);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (9)
55Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 85Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 117Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 144Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 172Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 203Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 231Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 258Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 315Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode);
src\Shared\ResultsTests\RedirectResultTestBase.cs (2)
35Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode); 58Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (9)
67Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 103Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 140Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 173Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 207Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 245Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 277Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 308Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 350Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode);
StatusCodeResultTests.cs (1)
24Assert.Equal(StatusCodes.Status404NotFound, httpContext.Response.StatusCode);
UnauthorizedResultTests.cs (1)
34Assert.Equal(StatusCodes.Status401Unauthorized, httpContext.Response.StatusCode);
UnprocessableEntityOfTResultTests.cs (1)
57Assert.Equal(StatusCodes.Status422UnprocessableEntity, httpContext.Response.StatusCode);
UnprocessableEntityResultTests.cs (1)
42Assert.Equal(StatusCodes.Status422UnprocessableEntity, httpContext.Response.StatusCode);
ValidationProblemResultTests.cs (2)
39Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 72Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Http.Tests (8)
ApplicationBuilderTests.cs (4)
22Assert.Equal(404, httpContext.Response.StatusCode); 39Assert.Equal(200, httpContext.Response.StatusCode); 100Assert.Equal(404, httpContext.Response.StatusCode); 123Assert.Equal(StatusCodes.Status204NoContent, httpContext.Response.StatusCode);
Timeouts\RequestTimeoutsMiddlewareTests.cs (4)
197Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 213Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 233Assert.Equal(111, context.Response.StatusCode); 250Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
Microsoft.AspNetCore.HttpLogging (4)
HttpLoggingFields.cs (1)
74/// Flag for logging the HTTP Response <see cref="HttpResponse.StatusCode"/>.
HttpLoggingMiddleware.cs (2)
335logContext.AddParameter(nameof(response.StatusCode), response.StatusCode);
W3CLoggingMiddleware.cs (1)
214shouldLog |= AddToList(elements, _protocolStatusIndex, StatusCodeHelper.ToStatusString(response.StatusCode));
Microsoft.AspNetCore.Mvc.Core (2)
Formatters\HttpNoContentOutputFormatter.cs (1)
38if (response.StatusCode == StatusCodes.Status200OK)
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
58context.ProblemDetails.Status ?? context.HttpContext.Response.StatusCode,
Microsoft.AspNetCore.Mvc.Core.Test (67)
AcceptedAtActionResultTests.cs (1)
167Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
AcceptedAtRouteResultTests.cs (1)
118Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
AcceptedResultTests.cs (2)
80Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode); 99Assert.Equal(StatusCodes.Status202Accepted, httpContext.Response.StatusCode);
CreatedAtActionResultTests.cs (1)
40Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
CreatedAtRouteResultTests.cs (1)
54Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
CreatedResultTests.cs (3)
74Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode); 90Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode); 108Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
FileResultHelperTest.cs (2)
419Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 457Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
Filters\MiddlewareFilterTest.cs (1)
212Assert.Equal(500, response.StatusCode);
Formatters\NoContentFormatterTests.cs (2)
130Assert.Equal(StatusCodes.Status204NoContent, context.HttpContext.Response.StatusCode); 172Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
Formatters\TextOutputFormatterTests.cs (1)
231Assert.Equal(StatusCodes.Status406NotAcceptable, context.HttpContext.Response.StatusCode);
HttpNotFoundObjectResultTest.cs (1)
52Assert.Equal(StatusCodes.Status404NotFound, httpContext.Response.StatusCode);
HttpOkObjectResultTest.cs (1)
63Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
HttpOkResultTest.cs (1)
39Assert.Equal(StatusCodes.Status200OK, context.HttpContext.Response.StatusCode);
HttpStatusCodeResultTests.cs (1)
32Assert.Equal(StatusCodes.Status404NotFound, httpContext.Response.StatusCode);
Infrastructure\ObjectResultExecutorTest.cs (2)
109Assert.Equal(406, httpContext.Response.StatusCode); 276Assert.Equal(StatusCodes.Status406NotAcceptable, actionContext.HttpContext.Response.StatusCode);
LocalRedirectResultTest.cs (1)
79Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode);
ObjectResultTests.cs (3)
59Assert.Equal(404, actionContext.HttpContext.Response.StatusCode); 122Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, actionContext.HttpContext.Response.StatusCode); 153Assert.Equal(StatusCodes.Status400BadRequest, actionContext.HttpContext.Response.StatusCode);
RedirectToActionResultTest.cs (2)
107Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 135Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
RedirectToRouteResultTest.cs (2)
136Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 161Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode);
src\Shared\ResultsTests\FileContentResultTestBase.cs (8)
83Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 122Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 158Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 192Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 224Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 257Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 291Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 325Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (10)
62Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 103Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 141Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 178Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 212Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 247Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 283Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 319Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 363Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 437Assert.Equal(200, httpContext.Response.StatusCode);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (9)
55Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 85Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 117Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 144Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 172Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 203Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 231Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 258Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 315Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode);
src\Shared\ResultsTests\RedirectResultTestBase.cs (2)
35Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode); 58Assert.Equal(StatusCodes.Status302Found, httpContext.Response.StatusCode);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (9)
67Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 103Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode); 140Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 173Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 207Assert.Equal(StatusCodes.Status200OK, httpResponse.StatusCode); 245Assert.Equal(StatusCodes.Status416RangeNotSatisfiable, httpResponse.StatusCode); 277Assert.Equal(StatusCodes.Status412PreconditionFailed, httpResponse.StatusCode); 308Assert.Equal(StatusCodes.Status304NotModified, httpResponse.StatusCode); 350Assert.Equal(StatusCodes.Status206PartialContent, httpResponse.StatusCode);
Microsoft.AspNetCore.Mvc.Cors.Test (4)
CorsAuthorizationFilterTest.cs (4)
41Assert.Equal(204, response.StatusCode); 69Assert.Equal(204, authorizationContext.HttpContext.Response.StatusCode); 91Assert.Equal(204, response.StatusCode); 112Assert.Equal(200, authorizationContext.HttpContext.Response.StatusCode);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
PartialViewResultExecutorTest.cs (1)
330Assert.Equal(404, context.HttpContext.Response.StatusCode);
ViewComponentResultTest.cs (1)
506Assert.Equal(404, actionContext.HttpContext.Response.StatusCode);
ViewExecutorTest.cs (2)
209Assert.Equal(200, context.Response.StatusCode); 246Assert.Equal(500, context.Response.StatusCode);
ViewResultExecutorTest.cs (1)
320Assert.Equal(404, context.HttpContext.Response.StatusCode);
Microsoft.AspNetCore.OpenApi.Tests (4)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (4)
69Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 99Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 131Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 160Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheMiddlewareTests.cs (1)
46Assert.Equal(StatusCodes.Status504GatewayTimeout, context.HttpContext.Response.StatusCode);
Microsoft.AspNetCore.Owin.Tests (1)
OwinEnvironmentTests.cs (1)
95Assert.Equal(201, context.Response.StatusCode);
Microsoft.AspNetCore.RateLimiting.Tests (21)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
62Assert.Equal(429, context.Response.StatusCode);
RateLimitingMetricsTests.cs (3)
48Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 105Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 160Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
RateLimitingMiddlewareTests.cs (17)
106Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 131Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 155Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 213Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 249Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 280Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 312Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 344Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 376Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 419Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 454Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 460Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 505Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 541Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 549Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 579Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 619Assert.Equal(StatusCodes.Status403Forbidden, context.Response.StatusCode);
Microsoft.AspNetCore.ResponseCaching (3)
ResponseCachingMiddleware.cs (1)
308StatusCode = response.StatusCode,
ResponseCachingPolicyProvider.cs (2)
116if (response.StatusCode != StatusCodes.Status200OK) 118context.Logger.ResponseWithUnsuccessfulStatusCodeNotCacheable(response.StatusCode);
Microsoft.AspNetCore.Rewrite (1)
RewriteMiddleware.cs (1)
105httpContext.Response.StatusCode);
Microsoft.AspNetCore.Rewrite.Tests (2)
UrlActions\ForbiddenActionTests.cs (1)
21Assert.Equal(StatusCodes.Status403Forbidden, context.HttpContext.Response.StatusCode);
UrlActions\GoneActionTests.cs (1)
20Assert.Equal(StatusCodes.Status410Gone, context.HttpContext.Response.StatusCode);
Microsoft.AspNetCore.Routing (1)
RequestDelegateFilterPipelineBuilder.cs (1)
34if (context.HttpContext.Response.StatusCode < 400)
Microsoft.AspNetCore.Routing.Tests (8)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (5)
645Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 832Assert.Equal(400, httpContext.Response.StatusCode); 852Assert.Equal(400, httpContext.Response.StatusCode); 908Assert.Equal(200, httpContext.Response.StatusCode); 979Assert.Equal(200, httpContext.Response.StatusCode);
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (3)
203Assert.Equal(405, httpContext.Response.StatusCode); 313Assert.Equal(405, httpContext.Response.StatusCode); 318Assert.Equal(405, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
ResponseTests.cs (1)
28Assert.Equal(200, httpContext.Response.StatusCode);
Microsoft.AspNetCore.StaticAssets (4)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
207if (ctx.Response.StatusCode == StatusCodes.Status200OK)
StaticAssetsInvoker.cs (3)
119if (context.Response.StatusCode == StatusCodes.Status200OK) 212if (requestContext.Response.StatusCode == StatusCodes.Status200OK) 224if (requestContext.Response.StatusCode == StatusCodes.Status200OK)
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
246if (_response.StatusCode == StatusCodes.Status200OK)
Microsoft.AspNetCore.TestHost (3)
ClientHandler.cs (1)
212response.StatusCode = (HttpStatusCode)httpContext.Response.StatusCode;
WebSocketClient.cs (2)
99if (httpContext.Response.StatusCode != StatusCodes.Status101SwitchingProtocols) 101throw new InvalidOperationException("Incomplete handshake, status code: " + httpContext.Response.StatusCode);
Microsoft.AspNetCore.TestHost.Tests (2)
ClientHandlerTests.cs (1)
60Assert.Equal(200, context.Response.StatusCode);
HttpContextBuilderTests.cs (1)
43Assert.Equal(404, context.Response.StatusCode);
MiddlewareAnalysisSample (1)
Startup.cs (1)
115Console.WriteLine($"MiddlewareFinished: {name}; {httpContext.Response.StatusCode}");