1 override of ContentLength
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
87public override long? ContentLength
26 writes to ContentLength
Microsoft.AspNetCore.Components.Endpoints (1)
Builder\ResourceCollectionUrlEndpoint.cs (1)
275context.Response.ContentLength = contents.Length;
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
59Response.ContentLength = null; // Clear any prior Content-Length
Microsoft.AspNetCore.HostFiltering (1)
HostFilteringMiddleware.cs (1)
72context.Response.ContentLength = DefaultResponse.Length;
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionContext.cs (1)
465nonClonedContext.Response.ContentLength = 0;
Internal\HttpConnectionDispatcher.cs (1)
398context.Response.ContentLength = writer.Length;
Internal\Transports\LongPollingServerTransport.cs (2)
54context.Response.ContentLength = buffer.Length; 86context.Response.ContentLength = 0;
Microsoft.AspNetCore.Http.Results (5)
HttpResultsHelper.cs (1)
90response.ContentLength = resolvedContentTypeEncoding.GetByteCount(content);
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (3)
136response.ContentLength = fileLength.Value; 317response.ContentLength = 0; 339response.ContentLength = length;
Utf8ContentHttpResult.cs (1)
67httpContext.Response.ContentLength = ResponseContent.Length;
Microsoft.AspNetCore.Mvc.Core (4)
Infrastructure\ContentResultExecutor.cs (1)
60response.ContentLength = resolvedContentTypeEncoding.GetByteCount(result.Content);
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (3)
136response.ContentLength = fileLength.Value; 317response.ContentLength = 0; 339response.ContentLength = length;
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
276response.ContentLength = fileBufferingWriteStream.Length;
XmlSerializerOutputFormatter.cs (1)
253response.ContentLength = fileBufferingWriteStream.Length;
Microsoft.AspNetCore.Rewrite (1)
UrlActions\CustomResponseAction.cs (1)
37response.ContentLength = content.Length;
Microsoft.AspNetCore.StaticAssets (3)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
223_context.Response.ContentLength = 0;
StaticAssetsInvoker.cs (2)
155context.Response.ContentLength = _length; 222requestContext.Response.ContentLength = length;
Microsoft.AspNetCore.StaticFiles (3)
HtmlDirectoryFormatter.cs (1)
205context.Response.ContentLength = bytes.Length;
StaticFileContext.cs (2)
269_response.ContentLength = _length; 381_response.ContentLength = length;
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
383response.ContentLength = errorResponse.Length;
8 references to ContentLength
Microsoft.AspNetCore.Diagnostics (1)
StatusCodePage\StatusCodePagesMiddleware.cs (1)
76|| context.Response.ContentLength.HasValue
Microsoft.AspNetCore.Hosting (3)
Internal\HostingRequestFinishedLog.cs (3)
383 => new KeyValuePair<string, object?>(nameof(response.ContentLength), response.ContentLength), 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.Abstractions (1)
HttpResponse.cs (1)
177public long? ContentLength => _response.ContentLength;
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
425var contentLength = context.HttpContext.Response.ContentLength;
Microsoft.AspNetCore.ResponseCaching (2)
ResponseCachingMiddleware.cs (2)
376var contentLength = context.HttpContext.Response.ContentLength; 384if (!response.ContentLength.HasValue && StringValues.IsNullOrEmpty(response.Headers.TransferEncoding))