1 override of Headers
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
62public override IHeaderDictionary Headers
168 references to Headers
Aspire.Dashboard (7)
DashboardEndpointsBuilder.cs (2)
237httpContext.Response.Headers.CacheControl = "no-cache"; 238httpContext.Response.Headers["X-Accel-Buffering"] = "no";
DashboardWebApplication.cs (2)
504if (context.Context.Response.Headers.CacheControl.Count == 0) 506context.Context.Response.Headers.CacheControl = "no-cache";
Model\BrowserSecurityHeadersMiddleware.cs (3)
69context.Response.Headers.ContentSecurityPolicy = context.Request.IsHttps 74context.Response.Headers["Referrer-Policy"] = "strict-origin-when-cross-origin"; 76context.Response.Headers.XContentTypeOptions = "nosniff";
Aspire.Dashboard.Tests (7)
BrowserSecurityHeadersMiddlewareTests.cs (7)
28Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 29Assert.DoesNotContain("default-src", httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 43Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 44Assert.Contains("default-src", httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 61Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 62Assert.Contains(expectedContent, httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 80Assert.Equal(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy);
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
58context.Response.Headers.ContentType = "multipart/related; type=\"application/xop+xml\";start=\"<http://tempuri.org/0>\";boundary=\"uuid:fca834ef-6b4a-43c0-a7d0-09064d2827e8+id=1\";start-info=\"text/xml\"";
Microsoft.AspNetCore.Antiforgery (5)
Internal\DefaultAntiforgery.cs (5)
247if (!_options.SuppressXFrameOptionsHeader && !httpContext.Response.Headers.ContainsKey(HeaderNames.XFrameOptions)) 252httpContext.Response.Headers.XFrameOptions = "SAMEORIGIN"; 364var responseHeaders = httpContext.Response.Headers; 387httpContext.Response.Headers.Pragma = "no-cache"; 392httpContext.Response.Headers.Pragma = "no-cache";
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenHandler.cs (1)
60Response.Headers.Append(HeaderNames.WWWAuthenticate, "Bearer");
Microsoft.AspNetCore.Authentication.Cookies (8)
CookieAuthenticationEvents.cs (4)
49context.Response.Headers.Location = context.RedirectUri; 66context.Response.Headers.Location = context.RedirectUri; 83context.Response.Headers.Location = context.RedirectUri; 99context.Response.Headers.Location = context.RedirectUri;
CookieAuthenticationHandler.cs (3)
418Response.Headers.CacheControl = HeaderValueNoCacheNoStore; 419Response.Headers.Pragma = HeaderValueNoCache; 420Response.Headers.Expires = HeaderValueEpocDate;
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
274var responseHeaders = context.Response.Headers;
Microsoft.AspNetCore.Authentication.OAuth (2)
OAuthHandler.cs (2)
279var location = Context.Response.Headers.Location; 285var cookie = Context.Response.Headers.SetCookie;
Microsoft.AspNetCore.Components.Endpoints (12)
Builder\ResourceCollectionUrlEndpoint.cs (6)
253context.Response.Headers[HeaderNames.ContentEncoding] = "gzip"; 254context.Response.Headers.ETag = _gzipContentETag; 259context.Response.Headers.ETag = new StringValues(_contentETag); 264context.Response.Headers[HeaderNames.CacheControl] = "max-age=31536000, immutable, no-transform"; 269context.Response.Headers[HeaderNames.CacheControl] = "no-cache, must-revalidate, no-transform"; 276context.Response.Headers[HeaderNames.Vary] = HeaderNames.AcceptEncoding;
RazorComponentEndpointInvoker.cs (1)
148context.Response.Headers.ContentEncoding = "identity";
Rendering\EndpointHtmlRenderer.Prerendering.cs (2)
84context.Response.Headers.Add("blazor-enhanced-nav", "allow"); 253httpContext.Response.Headers.Add("blazor-enhanced-nav-redirect-location",
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
35httpContext.Response.Headers.Add(_streamingRenderingFramingHeaderName, id); 285_httpContext.Response.Headers.CacheControl = "no-cache, no-store, max-age=0";
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
274var responseHeaders = context.Response.Headers;
Microsoft.AspNetCore.Components.Server (1)
Builder\ServerRazorComponentsEndpointConventionBuilderExtensions.cs (1)
58var headers = context.Response.Headers;
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsService.cs (1)
164var headers = response.Headers;
Microsoft.AspNetCore.Diagnostics (1)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
302var headers = ((HttpResponse)state).Headers;
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckMiddleware.cs (1)
64var headers = httpContext.Response.Headers;
Microsoft.AspNetCore.Diagnostics.Middleware (5)
Latency\AddServerTimingHeaderMiddleware.cs (3)
42if (httpContext.Response.Headers.TryGetValue(ServerTimingHeaderName, out var existing)) 44httpContext.Response.Headers[ServerTimingHeaderName] = $"{existing}, reqlatency;dur={elapsedMs}"; 48httpContext.Response.Headers.Append(ServerTimingHeaderName, $"reqlatency;dur={elapsedMs}");
Latency\RequestLatencyTelemetryMiddleware.cs (1)
68httpContext.Response.Headers[TelemetryConstants.ServerApplicationNameHeader] = _applicationName;
Logging\HttpLoggingRedactionInterceptor.cs (1)
147_responseHeadersReader.Read(context.Response.Headers, logContext.Parameters);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (8)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
45var header = context.Response.Headers[AddServerTimingHeaderMiddleware.ServerTimingHeaderName];
Latency\ChecpointAcceptanceTests.cs (1)
92ctx.Response.Headers.Append("Server-Timing", alreadySetServerTimingHeader);
Latency\RequestLatencyTelemetryMiddlewareTests.cs (5)
44var header = httpContextMock.Response.Headers[TelemetryConstants.ServerApplicationNameHeader]; 74Assert.False(httpContextMock.Response.Headers.TryGetValue(TelemetryConstants.ServerApplicationNameHeader, out var val)); 98httpContextMock.Response.Headers.Append(TelemetryConstants.ServerApplicationNameHeader, "testValue"); 102var header = httpContextMock.Response.Headers[TelemetryConstants.ServerApplicationNameHeader]; 133Assert.False(httpContextMock.Response.Headers.TryGetValue(TelemetryConstants.ServerApplicationNameHeader, out var val));
Logging\AcceptanceTests.cs (1)
134context.Response.Headers.Append(HeaderNames.TransferEncoding, "chunked");
Microsoft.AspNetCore.Hosting (3)
Internal\ErrorPageBuilder.cs (2)
31context.Response.Headers.CacheControl = "no-cache,no-store"; 32context.Response.Headers.Pragma = "no-cache";
Internal\HostingApplicationDiagnostics.cs (1)
580[DynamicDependency(nameof(HttpResponse.Headers), typeof(HttpResponse))]
Microsoft.AspNetCore.Http.Abstractions (2)
Extensions\ResponseTrailerExtensions.cs (1)
23response.Headers.AppendCommaSeparatedValues(HeaderNames.Trailer, trailerName);
HttpResponse.cs (1)
168public IHeaderDictionary Headers => _response.Headers;
Microsoft.AspNetCore.Http.Connections (6)
Internal\HttpConnectionDispatcher.cs (3)
834response.Headers.CacheControl = HeaderValueNoCacheNoStore; 835response.Headers.Pragma = HeaderValueNoCache; 836response.Headers.Expires = HeaderValueEpochDate;
Internal\Transports\ServerSentEventsServerTransport.cs (3)
34context.Response.Headers.CacheControl = "no-cache,no-store"; 35context.Response.Headers.Pragma = "no-cache"; 41context.Response.Headers.ContentEncoding = "identity";
Microsoft.AspNetCore.Http.Extensions (3)
HeaderDictionaryTypeExtensions.cs (1)
37return new ResponseHeaders(response.Headers);
ResponseExtensions.cs (2)
28response.Headers.Clear(); 53response.Headers.Location = location;
Microsoft.AspNetCore.Http.Results (15)
Accepted.cs (1)
69httpContext.Response.Headers.Location = Location;
AcceptedAtRoute.cs (1)
97httpContext.Response.Headers.Location = url;
AcceptedAtRouteOfT.cs (1)
111httpContext.Response.Headers.Location = url;
AcceptedOfT.cs (1)
81httpContext.Response.Headers.Location = Location;
Created.cs (1)
69httpContext.Response.Headers.Location = Location;
CreatedAtRoute.cs (1)
97httpContext.Response.Headers.Location = url;
CreatedAtRouteOfT.cs (1)
111httpContext.Response.Headers.Location = url;
CreatedOfT.cs (1)
80httpContext.Response.Headers.Location = Location;
RedirectHttpResult.cs (1)
114httpContext.Response.Headers.Location = destinationUrl;
RedirectToRouteHttpResult.cs (1)
183httpContext.Response.Headers.Location = destinationUrl;
ServerSentEventsResult.cs (3)
44httpContext.Response.Headers.CacheControl = "no-cache,no-store"; 45httpContext.Response.Headers.Pragma = "no-cache"; 46httpContext.Response.Headers.ContentEncoding = "identity";
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
354httpContext.Response.Headers.ContentDisposition = contentDisposition.ToString(); 373response.Headers.AcceptRanges = AcceptRangeHeaderValue;
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingFields.cs (1)
96/// Flag for logging the HTTP Response <see cref="HttpResponse.Headers"/>.
HttpLoggingMiddleware.cs (1)
346FilterHeaders(logContext, response.Headers, options._internalResponseHeaders);
Microsoft.AspNetCore.HttpsPolicy (2)
HstsMiddleware.cs (1)
76context.Response.Headers.StrictTransportSecurity = _strictTransportSecurityValue;
HttpsRedirectionMiddleware.cs (1)
110context.Response.Headers.Location = redirectUrl;
Microsoft.AspNetCore.Localization (1)
RequestLocalizationMiddleware.cs (1)
116var headers = context.Response.Headers;
Microsoft.AspNetCore.Mvc.Core (15)
AcceptedAtActionResult.cs (1)
90context.HttpContext.Response.Headers.Location = url;
AcceptedAtRouteResult.cs (1)
86context.HttpContext.Response.Headers.Location = url;
AcceptedResult.cs (1)
77context.HttpContext.Response.Headers.Location = Location;
CreatedAtActionResult.cs (1)
90context.HttpContext.Response.Headers.Location = url;
CreatedAtRouteResult.cs (1)
86context.HttpContext.Response.Headers.Location = url;
CreatedResult.cs (1)
85context.HttpContext.Response.Headers.Location = Location;
Filters\ResponseCacheFilterExecutor.cs (1)
69var headers = context.HttpContext.Response.Headers;
Infrastructure\LocalRedirectResultExecutor.cs (1)
56context.HttpContext.Response.Headers.Location = destinationUrl;
Infrastructure\RedirectResultExecutor.cs (1)
53context.HttpContext.Response.Headers.Location = destinationUrl;
Infrastructure\RedirectToActionResultExecutor.cs (1)
59context.HttpContext.Response.Headers.Location = destinationUrl;
Infrastructure\RedirectToPageResultExecutor.cs (1)
59context.HttpContext.Response.Headers.Location = destinationUrl;
Infrastructure\RedirectToRouteResultExecutor.cs (1)
55context.HttpContext.Response.Headers.Location = destinationUrl;
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
274var responseHeaders = context.Response.Headers;
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
354httpContext.Response.Headers.ContentDisposition = contentDisposition.ToString(); 373response.Headers.AcceptRanges = AcceptRangeHeaderValue;
Microsoft.AspNetCore.OutputCaching (5)
OutputCacheMiddleware.cs (4)
293context.HttpContext.Response.Headers[key] = values; 303cachedResponse.CopyHeadersTo(response.Headers); 308response.Headers.Age = HeaderUtilities.FormatNonNegativeInt64(context.CachedEntryAge.Ticks / TimeSpan.TicksPerSecond); 396var headers = response.Headers;
Policies\DefaultPolicy.cs (1)
47if (!StringValues.IsNullOrEmpty(response.Headers.SetCookie))
Microsoft.AspNetCore.ResponseCaching (12)
ResponseCachingContext.cs (4)
65if (HeaderUtilities.TryParseDate(HttpContext.Response.Headers.Date.ToString(), out date)) 92if (HeaderUtilities.TryParseDate(HttpContext.Response.Headers.Expires.ToString(), out expires)) 112HeaderUtilities.TryParseSeconds(HttpContext.Response.Headers.CacheControl, CacheControlHeaderValue.SharedMaxAgeString, out _responseSharedMaxAge); 125HeaderUtilities.TryParseSeconds(HttpContext.Response.Headers.CacheControl, CacheControlHeaderValue.MaxAgeString, out _responseMaxAge);
ResponseCachingMiddleware.cs (5)
163context.HttpContext.Response.Headers[key] = values; 175response.Headers[header.Key] = header.Value; 181response.Headers.Age = HeaderUtilities.FormatNonNegativeInt64(context.CachedEntryAge.Value.Ticks / TimeSpan.TicksPerSecond); 272var headers = response.Headers; 384if (!response.ContentLength.HasValue && StringValues.IsNullOrEmpty(response.Headers.TransferEncoding))
ResponseCachingPolicyProvider.cs (3)
68var responseCacheControlHeader = context.HttpContext.Response.Headers.CacheControl; 94if (!StringValues.IsNullOrEmpty(response.Headers.SetCookie)) 101var varyHeader = response.Headers.Vary;
Microsoft.AspNetCore.ResponseCompression (4)
ResponseCompressionBody.cs (2)
210var headers = context.Response.Headers; 240var headers = _context.Response.Headers;
ResponseCompressionProvider.cs (2)
177if (context.Response.Headers.ContainsKey(HeaderNames.ContentRange)) 183if (context.Response.Headers.ContainsKey(HeaderNames.ContentEncoding))
Microsoft.AspNetCore.Rewrite (8)
RedirectRule.cs (1)
100response.Headers.Location = encodedPath;
RedirectToHttpsRule.cs (1)
36response.Headers.Location = newUrl;
RedirectToWwwHelper.cs (1)
55response.Headers.Location = newUrl;
RewriteMiddleware.cs (1)
100httpContext.Response.Headers.Location.ToString(),
UrlActions\RedirectAction.cs (4)
42response.Headers.Location = pathBase.HasValue ? pathBase.Value : "/"; 64response.Headers.Location = pathBase + pattern.Substring(0, split) + query; 72response.Headers.Location = pathBase + pattern; 76response.Headers.Location = pathBase + pattern + context.HttpContext.Request.QueryString;
Microsoft.AspNetCore.Routing (1)
Matching\HttpMethodMatcherPolicy.cs (1)
388context.Response.Headers.Allow = allow;
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
146var responseHeaders = response.Headers;
Microsoft.AspNetCore.StaticAssets (8)
Development\StaticAssetDevelopmentRuntimeHandler.cs (7)
179_context.Response.Headers.ETag = ""; 195_context.Response.Headers.ContentLength = stream.Length; 198_context.Response.Headers.ETag = new StringValues($"\"{eTag}\""); 206_context.Response.Headers.ETag = ""; 208_context.Response.Headers.ETag = GetETag(fileInfo); 209_context.Response.Headers.LastModified = fileInfo.LastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture); 236_context.Response.Headers.ContentLength = fileInfo.Length;
StaticAssetsInvoker.cs (1)
233_logger.SendingFileRange(requestContext.Response.Headers.ContentRange, logPath);
Microsoft.AspNetCore.StaticFiles (2)
Helpers.cs (1)
46context.Response.Headers.Location = redirect;
StaticFileContext.cs (1)
388_logger.SendingFileRange(_response.Headers.ContentRange, logPath);
Microsoft.AspNetCore.Watch.BrowserRefresh (12)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (5)
72else if (context.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var contentEncodings)) 92if (!context.Response.Headers.ContainsKey("DOTNET-MODIFIABLE-ASSEMBLIES")) 96context.Response.Headers.Append("DOTNET-MODIFIABLE-ASSEMBLIES", _dotnetModifiableAssemblies); 108if (!context.Response.Headers.ContainsKey("ASPNETCORE-BROWSER-TOOLS")) 112context.Response.Headers.Append("ASPNETCORE-BROWSER-TOOLS", _aspnetcoreBrowserTools);
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserScriptMiddleware.cs (3)
39context.Response.Headers["Cache-Control"] = "no-store"; 40context.Response.Headers["Content-Length"] = _contentLength; 41context.Response.Headers["Content-Type"] = "application/javascript; charset=utf-8";
src\sdk\src\Dotnet.Watch\Web.Middleware\HostingStartup.cs (1)
44context.Response.Headers["Clear-Site-Data"] = "\"cache\"";
src\sdk\src\Dotnet.Watch\Web.Middleware\ResponseStreamWrapper.cs (3)
120response.Headers.ContentLength = null; 130if (response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var contentEncodingValues)) 136response.Headers.Remove(HeaderNames.ContentEncoding);
Microsoft.AspNetCore.WebSockets (2)
WebSocketMiddleware.cs (2)
165HandshakeHelpers.GenerateResponseHeaders(!_isH2WebSocket, _context.Request.Headers, subProtocol, _context.Response.Headers); 184_context.Response.Headers.SecWebSocketExtensions = response;
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
353context.Response.Headers.Location = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.Path}/{sessionId}";
Stress.ApiService (2)
Program.cs (2)
871context.Response.Headers["Content-Type"] = "text/plain; charset=utf-8"; 872context.Response.Headers["Cache-Control"] = "no-cache";
WebPubSubWeb (1)
Program.cs (1)
55context.Response.Headers["WebHook-Allowed-Origin"] = "*";