1 override of ContentType
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
93public override string? ContentType
256 writes to ContentType
Aspire.Dashboard (1)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (1)
157httpContext.Response.ContentType = ProtobufContentType;
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
16context.Response.ContentType = "text/plain";
AzureAppServicesSample (1)
Startup.cs (1)
27context.Response.ContentType = "text/plain";
BasicWebSite (3)
Controllers\ContentNegotiation\InvalidContentTypeController.cs (1)
13HttpContext.Response.ContentType = "json";
Formatters\CustomFormatter.cs (1)
37response.ContentType = ContentType + ";charset=utf-8";
Formatters\PlainTextFormatter.cs (1)
35response.ContentType = "text/plain;charset=utf-8";
Benchmarks (2)
StartupUsingEndpointRouting.cs (1)
32response.ContentType = "text/plain";
StartupUsingRouter.cs (1)
26response.ContentType = "text/plain";
CookiePolicySample (1)
Startup.cs (1)
81response.ContentType = "text/html";
CookieSample (2)
Program.cs (2)
46context.Response.ContentType = "text/plain"; 51context.Response.ContentType = "text/plain";
CookieSessionSample (2)
Startup.cs (2)
45context.Response.ContentType = "text/plain"; 50context.Response.ContentType = "text/plain";
CorsMiddlewareWebSite (1)
EchoMiddleware.cs (1)
27context.Response.ContentType = "text/plain; charset=utf-8";
ExceptionHandlerSample (3)
Startup.cs (2)
20context.Response.ContentType = "text/html"; 50context.Response.ContentType = "text/html";
StartupWithProblemDetails.cs (1)
48context.Response.ContentType = "text/html";
FormatterWebSite (2)
Controllers\StreamController.cs (2)
19Response.ContentType = "text/html"; 43Response.ContentType = "text/html";
HealthChecksSample (1)
CustomWriterStartup.cs (1)
43httpContext.Response.ContentType = "application/json";
HotAddSample (3)
Startup.cs (3)
42context.Response.ContentType = "text/html"; 68context.Response.ContentType = "text/html"; 87context.Response.ContentType = "text/html";
HttpAbstractions.SampleApp (1)
Program.cs (1)
42response.ContentType = "application/json";
HttpLogging.Sample (1)
Startup.cs (1)
30context.Response.ContentType = "text/plain";
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
68response.ContentType = "text/plain";
IISSample (1)
Startup.cs (1)
41context.Response.ContentType = "text/plain";
InMemory.FunctionalTests (6)
Http2\Http2StreamTests.cs (2)
2145Assert.Throws<InvalidOperationException>(() => context.Response.ContentType = "Custom 你好 Type"); 2187context.Response.ContentType = "Custom 你好 Type";
Http3\Http3StreamTests.cs (2)
863Assert.Throws<InvalidOperationException>(() => context.Response.ContentType = "Custom 你好 Type"); 898context.Response.ContentType = "Custom 你好 Type";
ResponseHeaderTests.cs (2)
24Assert.Throws<InvalidOperationException>(() => context.Response.ContentType = "Custom 你好 Type"); // Special cased 56context.Response.ContentType = "Custom 你好 Type";
InProcessWebSite (4)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (4)
211context.Response.ContentType = "text/html"; 450ctx.Response.ContentType = "text/plain"; 661ctx.Response.ContentType = contentType; 693ctx.Response.ContentType = contentType;
Interop.FunctionalTests (3)
HttpClientHttp2InteropTests.cs (3)
410context.Response.ContentType = "text/plain"; 707context.Response.ContentType = "text/plain"; 766context.Response.ContentType = "text/plain";
JwtBearerSample (1)
Startup.cs (1)
86response.ContentType = "application/json";
Kestrel.SampleApp (1)
Startup.cs (1)
62context.Response.ContentType = "text/plain";
LargeResponseApp (1)
Startup.cs (1)
32context.Response.ContentType = "text/plain";
LocalizationSample (1)
Startup.cs (1)
42context.Response.ContentType = "text/html; charset=utf-8";
Logging.W3C.Sample (1)
Startup.cs (1)
33context.Response.ContentType = "text/plain";
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectHandler.cs (2)
291Response.ContentType = "text/html;charset=UTF-8"; 539Response.ContentType = "text/html;charset=UTF-8";
Microsoft.AspNetCore.Authentication.Test (4)
CertificateTests.cs (1)
828response.ContentType = "text/xml";
CookieTests.cs (1)
1889res.ContentType = "text/xml";
TestExtensions.cs (2)
48res.ContentType = "text/xml"; 67res.ContentType = "text/xml";
Microsoft.AspNetCore.Components.Endpoints (4)
Builder\ResourceCollectionUrlEndpoint.cs (1)
236context.Response.ContentType = "application/javascript";
RazorComponentEndpointInvoker.cs (1)
40context.Response.ContentType = RazorComponentResultExecutor.DefaultContentType;
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
71_httpContext.Response.ContentType = "text/plain";
Results\RazorComponentResultExecutor.cs (1)
27response.ContentType = result.ContentType ?? DefaultContentType;
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (1)
123fileContext.Context.Response.ContentType = originalContentType;
TargetPickerUi.cs (2)
113context.Response.ContentType = "text/html"; 265context.Response.ContentType = "text/html";
Microsoft.AspNetCore.Diagnostics (7)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
235httpContext.Response.ContentType = "text/plain; charset=utf-8";
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
58Response.ContentType = "text/html; charset=utf-8";
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
65Response.ContentType = "text/html; charset=utf-8";
StatusCodePage\StatusCodePagesExtensions.cs (1)
79context.HttpContext.Response.ContentType = contentType;
StatusCodePage\StatusCodePagesOptions.cs (1)
34context.HttpContext.Response.ContentType = "text/plain";
WelcomePage\Views\Obsolete\WelcomePage.cs (1)
30Response.ContentType = "text/html";
WelcomePage\Views\WelcomePage.Designer.cs (1)
29Response.ContentType = "text/html; charset=utf-8";
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
MigrationsEndPointMiddleware.cs (1)
136response.ContentType = "text/plain";
Views\DatabaseErrorPage.Designer.cs (1)
44Response.ContentType = "text/html; charset=utf-8";
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckResponseWriters.cs (1)
18httpContext.Response.ContentType = "text/plain";
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (2)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (1)
103context.Response.ContentType = "text/plain";
HealthCheckMiddlewareTests.cs (1)
308c.Response.ContentType = "application/json";
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (2)
72context.Response.ContentType = MediaTypeNames.Text.Plain; 89context.Response.ContentType = MediaTypeNames.Text.Plain;
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerTest.cs (1)
50context.Response.ContentType = "text/plain; charset=utf-8";
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\JsonRequestHelpers.cs (1)
92response.ContentType = MediaType.ReplaceEncoding("application/json", encoding);
Internal\JsonTranscodingServerCallContext.cs (1)
239HttpContext.Response.ContentType = contentType ?? MediaType.ReplaceEncoding("application/json", RequestEncoding);
Microsoft.AspNetCore.HostFiltering (1)
HostFilteringMiddleware.cs (1)
73context.Response.ContentType = "text/html";
Microsoft.AspNetCore.Hosting (1)
Internal\ErrorPageBuilder.cs (1)
33context.Response.ContentType = "text/html; charset=utf-8";
Microsoft.AspNetCore.Http.Connections (27)
Internal\HttpConnectionContext.cs (5)
462nonClonedContext.Response.ContentType = "application/octet-stream"; 518nonClonedContext.Response.ContentType = "text/plain"; 528nonClonedContext.Response.ContentType = "text/plain"; 561context.Response.ContentType = "text/plain"; 575context.Response.ContentType = "text/plain";
Internal\HttpConnectionDispatcher.cs (15)
96context.Response.ContentType = "text/plain"; 115context.Response.ContentType = "text/plain"; 338context.Response.ContentType = "application/json"; 458context.Response.ContentType = "text/plain"; 480context.Response.ContentType = "text/plain"; 498context.Response.ContentType = "text/plain"; 507context.Response.ContentType = "text/plain"; 524context.Response.ContentType = "text/plain"; 556context.Response.ContentType = "text/plain"; 567context.Response.ContentType = "text/plain"; 574context.Response.ContentType = "text/plain"; 591context.Response.ContentType = "text/plain"; 595context.Response.ContentType = "text/plain"; 781context.Response.ContentType = "text/plain"; 791context.Response.ContentType = "text/plain";
Internal\Transports\LongPollingServerTransport.cs (6)
44context.Response.ContentType = "text/plain"; 55context.Response.ContentType = "application/octet-stream"; 87context.Response.ContentType = "text/plain"; 93context.Response.ContentType = "text/plain"; 101context.Response.ContentType = "text/plain"; 108context.Response.ContentType = "text/plain";
Internal\Transports\ServerSentEventsServerTransport.cs (1)
33context.Response.ContentType = "text/event-stream";
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
3859context.Response.ContentType = "application/xml";
Microsoft.AspNetCore.Http.Extensions (6)
HttpResponseJsonExtensions.cs (5)
91response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 122response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 164response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 270response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 321response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset;
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
33httpContext.Response.ContentType ??= "text/plain; charset=utf-8";
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (1)
776httpContext.Response.ContentType = "binary; charset=utf-31";
Microsoft.AspNetCore.Http.Results (3)
HttpResultsHelper.cs (1)
78response.ContentType = resolvedContentType;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
126response.ContentType = result.ContentType;
Utf8ContentHttpResult.cs (1)
65httpContext.Response.ContentType = ContentType ?? ContentTypeConstants.DefaultContentType;
Microsoft.AspNetCore.Http.Results.Tests (1)
ContentResultTests.cs (1)
114httpContext.Response.ContentType = responseContentType;
Microsoft.AspNetCore.HttpLogging.Tests (18)
HttpLoggingMiddlewareTests.cs (18)
821c.Response.ContentType = "text/plain"; 844c.Response.ContentType = "text/plain"; 868c.Response.ContentType = "text/plain"; 890c.Response.ContentType = "text/plain"; 914c.Response.ContentType = "text/plain"; 940c.Response.ContentType = "text/plain"; 964c.Response.ContentType = "text/plain"; 1030c.Response.ContentType = "text/plain"; 1050c.Response.ContentType = "text/plain"; 1071c.Response.ContentType = "text/plain"; 1098c.Response.ContentType = "text/plain"; 1136c.Response.ContentType = "text/plain"; 1167c.Response.ContentType = "foo/*"; 1404c.Response.ContentType = "text/plain"; 1514c.Response.ContentType = "text/plain2"; 1581c.Response.ContentType = "text/plain2"; 2001context.Response.ContentType = "text/plain; p=response"; 2046c.Response.ContentType = "text/plain";
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
408res.ContentType = "text/xml";
Microsoft.AspNetCore.Mvc.Core (5)
Formatters\OutputFormatter.cs (1)
174response.ContentType = context.ContentType.Value ?? string.Empty;
Formatters\StreamOutputFormatter.cs (1)
37response.ContentType = context.ContentType.ToString();
Infrastructure\ContentResultExecutor.cs (1)
49response.ContentType = resolvedContentType;
Infrastructure\SystemTextJsonResultExecutor.cs (1)
51response.ContentType = resolvedContentType;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
126response.ContentType = result.ContentType;
Microsoft.AspNetCore.Mvc.Core.Test (13)
ContentResultTest.cs (1)
130httpContext.Response.ContentType = responseContentType;
Infrastructure\JsonResultExecutorTestBase.cs (4)
70context.HttpContext.Response.ContentType = "text/json; charset=utf-8"; 94context.HttpContext.Response.ContentType = "text/json; charset=utf-16"; 139context.HttpContext.Response.ContentType = expectedContentType; 164context.HttpContext.Response.ContentType = responseContentType;
Infrastructure\ObjectResultExecutorTest.cs (8)
27httpContext.Response.ContentType = "text/json"; 55httpContext.Response.ContentType = "text/plain"; 78httpContext.Response.ContentType = "application/json"; 100httpContext.Response.ContentType = "application/json"; 120httpContext.Response.ContentType = "application/xml"; // This will not be used 145httpContext.Response.ContentType = "application/json"; // This will not be used 167httpContext.Response.ContentType = "application/json"; // This will not be used 190httpContext.Response.ContentType = "application/xml"; // This will not be used
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonResultExecutor.cs (1)
85response.ContentType = resolvedContentType;
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (4)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (4)
70context.HttpContext.Response.ContentType = "text/json; charset=utf-8"; 94context.HttpContext.Response.ContentType = "text/json; charset=utf-16"; 139context.HttpContext.Response.ContentType = expectedContentType; 164context.HttpContext.Response.ContentType = responseContentType;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponentResultExecutor.cs (1)
94response.ContentType = resolvedContentType;
ViewExecutor.cs (1)
197response.ContentType = resolvedContentType;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (3)
ViewComponentResultTest.cs (2)
595actionContext.HttpContext.Response.ContentType = "application/x-will-be-overridden"; 633actionContext.HttpContext.Response.ContentType = expectedContentType;
ViewExecutorTest.cs (1)
135context.Response.ContentType = responseContentType;
Microsoft.AspNetCore.OpenApi (3)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (3)
41context.Response.ContentType = "text/plain;charset=utf-8"; 55context.Response.ContentType = "text/plain+yaml;charset=utf-8"; 60context.Response.ContentType = "application/json;charset=utf-8";
Microsoft.AspNetCore.ResponseCompression.Tests (17)
ResponseCompressionMiddlewareTest.cs (17)
166context.Response.ContentType = TextPlain; 324context.Response.ContentType = contentType; 461context.Response.ContentType = TextPlain; 524context.Response.ContentType = TextPlain; 587context.Response.ContentType = TextPlain; 639context.Response.ContentType = TextPlain; 685context.Response.ContentType = TextPlain; 736context.Response.ContentType = TextPlain; 789context.Response.ContentType = TextPlain; 849context.Response.ContentType = TextPlain; 919context.Response.ContentType = TextPlain; 983context.Response.ContentType = "Un/compressed"; 1048context.Response.ContentType = "custom/type"; 1098context.Response.ContentType = TextPlain; 1148context.Response.ContentType = TextPlain; 1198context.Response.ContentType = TextPlain; 1259context.Response.ContentType = responseType;
Microsoft.AspNetCore.Rewrite (1)
UrlActions\CustomResponseAction.cs (1)
41response.ContentType = "text/plain; charset=utf-8";
Microsoft.AspNetCore.Routing (1)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
33httpContext.Response.ContentType ??= "text/plain; charset=utf-8";
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (18)
ResponseCachingTests.cs (17)
51httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 70httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 112httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 157httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 177httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 197httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 217httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 237httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 261httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 284httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 305httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 325httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 346httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 367httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 389httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 408httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching 428httpContext.Response.ContentType = "some/thing"; // Http.Sys requires content-type for caching
ResponseTests.cs (1)
242httpContext.Response.ContentType = "text/plain";
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (8)
HeaderCollectionBenchmark.cs (3)
127_response.ContentType = "text/plain"; 149_response.ContentType = "text/css"; 189_response.ContentType = "text/plain";
InMemoryTransportBenchmark.cs (1)
263response.ContentType = "text/plain";
NamedPipesTransportBenchmark.cs (1)
161response.ContentType = "text/plain";
ResponseHeaderCollectionBenchmark.cs (3)
100_response.ContentType = "text/plain"; 117_response.ContentType = "text/css"; 152_response.ContentType = "text/plain";
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyMiddleware.cs (1)
60context.Response.ContentType = "text/html";
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
97context.Response.ContentType = _contentType;
Microsoft.AspNetCore.StaticFiles (2)
HtmlDirectoryFormatter.cs (1)
40context.Response.ContentType = TextHtmlUtf8;
StaticFileContext.cs (1)
256_response.ContentType = _contentType;
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
384ctx.Response.ContentType = "text/customfortest+plain";
MiddlewareAnalysisSample (1)
Startup.cs (1)
62context.Response.ContentType = "text/html";
NativeIISSample (1)
Startup.cs (1)
34context.Response.ContentType = "text/plain";
OpenIdConnectSample (2)
Startup.cs (2)
129c.Response.ContentType = "text/plain"; 331response.ContentType = "text/html";
OutputCachingSample (1)
Gravatar.cs (1)
13context.Response.ContentType = "text/html";
PlaintextApp (1)
Startup.cs (1)
29response.ContentType = "text/plain";
QueueSharing (1)
Program.cs (1)
61context.Response.ContentType = "text/plain";
ResponseCompressionSample (3)
Startup.cs (3)
37context.Response.ContentType = "text/plain"; 46context.Response.ContentType = "text/plain"; 61context.Response.ContentType = "text/plain";
RoutingSandbox (3)
HelloExtension\HelloMiddleware.cs (1)
35response.ContentType = "text/plain";
UseEndpointRoutingStartup.cs (2)
50response.ContentType = "text/plain"; 60response.ContentType = "text/plain";
RoutingWebSite (8)
HelloExtension\HelloMiddleware.cs (1)
35response.ContentType = "text/plain";
UseEndpointRoutingStartup.cs (7)
52response.ContentType = "text/plain"; 62response.ContentType = "text/plain"; 82response.ContentType = "text/plain"; 91response.ContentType = "text/plain"; 102response.ContentType = "text/plain"; 114response.ContentType = "text/plain"; 143response.ContentType = "text/plain";
SelfHostServer (1)
Startup.cs (1)
30context.Response.ContentType = "text/plain";
ServerComparison.TestSites (3)
StartupResponseCompression.cs (3)
28context.Response.ContentType = "text/plain"; 39context.Response.ContentType = "text/plain"; 46context.Response.ContentType = "text/plain";
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
263context.Response.ContentType = "application/json";
SignalRSamples (1)
Startup.cs (1)
54context.Response.ContentType = "application/json";
SocialSample (8)
Startup.cs (8)
217context.Response.ContentType = "text/html"; 260response.ContentType = "text/html"; 312response.ContentType = "text/html"; 385response.ContentType = "text/html"; 399response.ContentType = "text/html"; 414response.ContentType = "text/html"; 448response.ContentType = "text/html"; 492response.ContentType = "text/html";
StatusCodePagesSample (2)
Startup.cs (2)
74context.Response.ContentType = "text/html"; 102context.Response.ContentType = "text/html";
SystemdTestApp (1)
Startup.cs (1)
34context.Response.ContentType = "text/plain";
WebTransportInteractiveSampleApp (1)
Program.cs (1)
49context.Response.ContentType = "application/javascript";
WsFedSample (1)
Startup.cs (1)
133response.ContentType = "text/html";
107 references to ContentType
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
RazorComponentResultTest.cs (2)
65Assert.Equal("text/html; charset=utf-8", httpContext.Response.ContentType); 87Assert.Equal("application/test-content-type", httpContext.Response.ContentType);
Microsoft.AspNetCore.Diagnostics (1)
StatusCodePage\StatusCodePagesMiddleware.cs (1)
71|| !string.IsNullOrEmpty(context.Response.ContentType))
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (6)
ServerStreamingServerCallHandlerTests.cs (2)
64Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 245Assert.Equal("application/xml", httpContext.Response.ContentType);
UnaryServerCallHandlerTests.cs (4)
74Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 1151Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 1205Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 1364Assert.Equal("application/xml", httpContext.Response.ContentType);
Microsoft.AspNetCore.Hosting (3)
Internal\HostingRequestFinishedLog.cs (3)
372 => new KeyValuePair<string, object?>(nameof(response.ContentType), response.ContentType), 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";
Microsoft.AspNetCore.Http (2)
src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
23if (!string.IsNullOrEmpty(response.ContentType)) 26sb.Append(response.ContentType);
Microsoft.AspNetCore.Http.Connections.Tests (8)
HttpConnectionDispatcherTests.cs (7)
803Assert.Equal("application/octet-stream", context.Response.ContentType); 833Assert.Equal("application/xml", connectionHttpContext.Response.ContentType); 2044Assert.Equal("text/plain", deleteContext.Response.ContentType); 2093Assert.Equal("text/plain", deleteContext.Response.ContentType); 2135Assert.Equal("text/plain", deleteContext.Response.ContentType); 2197Assert.Equal("text/plain", deleteContext.Response.ContentType); 2803Assert.Equal("text/plain", deleteContext.Response.ContentType);
ServerSentEventsTests.cs (1)
34Assert.Equal("text/event-stream", context.Response.ContentType);
Microsoft.AspNetCore.Http.Extensions.Tests (19)
HttpResponseJsonExtensionsTests.cs (16)
32Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 51Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 71Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 103Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 119Assert.Equal("application/custom-type", context.Response.ContentType); 173Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 192Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 255Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 271Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 296Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 324Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 358Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 392Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 426Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 460Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 481Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType);
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
257Assert.Equal(expectedContentType, httpContext.Response.ContentType);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (2)
765Assert.Equal("text/plain; charset=utf-8", httpContext.Response.ContentType); 780Assert.Equal("binary; charset=utf-31", httpContext.Response.ContentType);
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
257Assert.Equal(expectedContentType, httpContext.Response.ContentType);
Microsoft.AspNetCore.Http.Results (2)
HttpResultsHelper.cs (1)
72response.ContentType,
src\Shared\ResponseContentTypeHelper.cs (1)
17/// 2. <see cref="HttpResponse.ContentType"/> property set on <see cref="HttpResponse"/>
Microsoft.AspNetCore.Http.Results.Tests (8)
ContentResultTests.cs (2)
30Assert.Equal("text/plain; charset=utf-16", httpContext.Response.ContentType); 120var finalResponseContentType = httpContext.Response.ContentType;
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
350Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
417Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
336Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
371Assert.Equal(expectedContentType, httpContext.Response.ContentType);
Utf8ContentResultTests.cs (2)
45Assert.Equal("text/plain; charset=utf-8", context.Response.ContentType); 63Assert.Equal("text/plain; charset=utf-8", context.Response.ContentType);
Microsoft.AspNetCore.Http.Tests (1)
Internal\DefaultHttpResponseTests.cs (1)
56Assert.Null(response.ContentType);
Microsoft.AspNetCore.HttpLogging (1)
ResponseBufferingStream.cs (1)
128if (MediaTypeHelpers.TryGetEncodingForMediaType(_logContext.HttpContext.Response.ContentType,
Microsoft.AspNetCore.Mvc.Core (5)
Formatters\FormatFilter.cs (1)
151!string.IsNullOrEmpty(context.HttpContext.Response.ContentType))
Infrastructure\ContentResultExecutor.cs (1)
43response.ContentType,
Infrastructure\ObjectResultExecutor.cs (1)
128var responseContentType = context.HttpContext.Response.ContentType;
Infrastructure\SystemTextJsonResultExecutor.cs (1)
45response.ContentType,
src\Shared\ResponseContentTypeHelper.cs (1)
17/// 2. <see cref="HttpResponse.ContentType"/> property set on <see cref="HttpResponse"/>
Microsoft.AspNetCore.Mvc.Core.Test (26)
ContentResultTest.cs (2)
42MediaTypeAssert.Equal("text/plain; charset=utf-16", httpContext.Response.ContentType); 137var finalResponseContentType = httpContext.Response.ContentType;
FileResultHelperTest.cs (2)
95Assert.Equal("application/my-type", httpContext.Response.ContentType); 116Assert.Equal("application/my-type", httpContext.Response.ContentType);
Formatters\FormatFilterTest.cs (1)
363response.Setup(r => r.ContentType).Returns("application/foo");
Infrastructure\JsonResultExecutorTestBase.cs (8)
39Assert.Equal("application/json; charset=utf-8", context.HttpContext.Response.ContentType); 60Assert.Equal("text/json", context.HttpContext.Response.ContentType); 84Assert.Equal("text/json; charset=utf-16", context.HttpContext.Response.ContentType); 104Assert.Equal("text/json; charset=utf-16", context.HttpContext.Response.ContentType); 128Assert.Equal("text/json; charset=us-ascii", context.HttpContext.Response.ContentType); 150Assert.Equal(expectedContentType, context.HttpContext.Response.ContentType); 175Assert.Equal(expectedContentType, context.HttpContext.Response.ContentType); 199Assert.Equal("application/json; charset=utf-8", context.HttpContext.Response.ContentType);
Infrastructure\ObjectResultExecutorTest.cs (9)
41MediaTypeAssert.Equal("text/xml; charset=utf-8", httpContext.Response.ContentType); 66MediaTypeAssert.Equal("text/plain; charset=utf-8", httpContext.Response.ContentType); 88Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 134MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 156MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 178MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 204MediaTypeAssert.Equal("application/problem+json; charset=utf-8", httpContext.Response.ContentType); 229MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 250MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType);
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
350Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
417Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
336Assert.Equal(expectedContentType, httpContext.Response.ContentType);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
371Assert.Equal(expectedContentType, httpContext.Response.ContentType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
NewtonsoftJsonResultExecutor.cs (1)
79response.ContentType,
src\Shared\ResponseContentTypeHelper.cs (1)
17/// 2. <see cref="HttpResponse.ContentType"/> property set on <see cref="HttpResponse"/>
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (9)
JsonResultTest.cs (1)
36Assert.Equal("application/json; charset=utf-8", context.HttpContext.Response.ContentType);
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (8)
39Assert.Equal("application/json; charset=utf-8", context.HttpContext.Response.ContentType); 60Assert.Equal("text/json", context.HttpContext.Response.ContentType); 84Assert.Equal("text/json; charset=utf-16", context.HttpContext.Response.ContentType); 104Assert.Equal("text/json; charset=utf-16", context.HttpContext.Response.ContentType); 128Assert.Equal("text/json; charset=us-ascii", context.HttpContext.Response.ContentType); 150Assert.Equal(expectedContentType, context.HttpContext.Response.ContentType); 175Assert.Equal(expectedContentType, context.HttpContext.Response.ContentType); 199Assert.Equal("application/json; charset=utf-8", context.HttpContext.Response.ContentType);
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponentResultExecutor.cs (1)
88response.ContentType,
ViewExecutor.cs (1)
191response.ContentType,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (6)
PartialViewResultExecutorTest.cs (1)
301Assert.Equal("application/x-my-content-type", context.HttpContext.Response.ContentType);
ViewComponentResultTest.cs (3)
568var resultContentType = actionContext.HttpContext.Response.ContentType; 609Assert.Equal(expectedContentType, actionContext.HttpContext.Response.ContentType); 646Assert.Equal(expectedContentType, actionContext.HttpContext.Response.ContentType);
ViewExecutorTest.cs (1)
155MediaTypeAssert.Equal(expectedContentType, context.Response.ContentType);
ViewResultExecutorTest.cs (1)
296Assert.Equal("application/x-my-content-type", context.HttpContext.Response.ContentType);
Microsoft.AspNetCore.OpenApi.Tests (2)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (2)
100Assert.Equal(expectedContentType, context.Response.ContentType); 161Assert.Equal(expectedContentType, context.Response.ContentType);
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
188var mimeType = context.Response.ContentType;