1 write to Headers
Microsoft.Extensions.Http.Resilience.Tests (1)
Polly\HttpRetryStrategyOptionsTests.cs (1)
132Headers =
110 references to Headers
aspire (2)
Mcp\Docs\DocsFetcher.cs (2)
78var retryETag = retryResponse.Headers.ETag?.Tag; 99var newETag = response.Headers.ETag?.Tag;
Aspire.Cli.Tests (2)
Mcp\Docs\DocsFetcherTests.cs (2)
47response.Headers.ETag = new System.Net.Http.Headers.EntityTagHeaderValue("\"abc123\""); 151response.Headers.ETag = new System.Net.Http.Headers.EntityTagHeaderValue("\"new-etag\"");
Aspire.Dashboard.Tests (31)
Integration\FrontendOpenIdConnectAuthTests.cs (1)
44var redirectedTo = response.Headers.Location;
Integration\McpServiceTests.cs (1)
347var sessionId = initResponse.Headers.GetValues("Mcp-Session-Id").First();
Integration\OtlpCorsHttpServiceTests.cs (12)
63Assert.Equal("http://localhost:8000", responseMessage1.Headers.GetValues("Access-Control-Allow-Origin").Single()); 64Assert.Equal("POST", responseMessage1.Headers.GetValues("Access-Control-Allow-Methods").Single()); 65Assert.Equal("X-Requested-With", responseMessage1.Headers.GetValues("Access-Control-Allow-Headers").Single()); 77Assert.Equal("http://localhost:8001", responseMessage2.Headers.GetValues("Access-Control-Allow-Origin").Single()); 78Assert.Equal("POST", responseMessage2.Headers.GetValues("Access-Control-Allow-Methods").Single()); 79Assert.Equal("X-Requested-With", responseMessage2.Headers.GetValues("Access-Control-Allow-Headers").Single()); 104Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Origin")); 105Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Methods")); 106Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Headers")); 132Assert.Equal("*", responseMessage.Headers.GetValues("Access-Control-Allow-Origin").Single()); 133Assert.Equal("POST", responseMessage.Headers.GetValues("Access-Control-Allow-Methods").Single()); 134Assert.Equal("x-requested-with,x-custom,Content-Type", responseMessage.Headers.GetValues("Access-Control-Allow-Headers").Single());
Integration\OtlpHttpServiceTests.cs (5)
57Assert.False(responseMessage.Headers.Contains("content-security-policy")); 183Assert.False(responseMessage.Headers.Contains("content-security-policy")); 348Assert.False(responseMessage.Headers.Contains("content-security-policy")); 377Assert.False(responseMessage.Headers.Contains("content-security-policy")); 406Assert.False(responseMessage.Headers.Contains("content-security-policy"));
Integration\StartupTests.cs (2)
537Assert.True(responseMessage.Headers.Contains("content-security-policy")); 991Assert.NotEmpty(response.Headers.GetValues(HeaderNames.ContentSecurityPolicy).Single());
Integration\TelemetryApiTests.cs (4)
423Assert.Equal("no-cache", response.Headers.CacheControl?.ToString()); 424Assert.True(response.Headers.TryGetValues("X-Accel-Buffering", out var bufferingValues)); 454Assert.Equal("no-cache", response.Headers.CacheControl?.ToString()); 455Assert.True(response.Headers.TryGetValues("X-Accel-Buffering", out var bufferingValues));
Middleware\ValidateTokenMiddlewareTests.cs (6)
23Assert.Equal("/", response.Headers.Location?.OriginalString); 31Assert.Equal("/test", response.Headers.Location?.OriginalString); 39Assert.Equal("/login", response.Headers.Location?.OriginalString); 47Assert.Equal("/login?returnUrl=%2ftest", response.Headers.Location?.OriginalString); 55Assert.Equal("/", response.Headers.Location?.OriginalString); 63Assert.Equal("/test", response.Headers.Location?.OriginalString);
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (2)
45HttpRequestMessageExtensionMethods.MergeWebHeaderCollectionWithHttpHeaders(headersToMerge, responseMessage.Headers, responseMessage.Content.Headers); 50IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers = httpResponse.Headers;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
358_httpResponseMessage.Headers.WwwAuthenticate.ToString());
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
238var errorMessage = $"OAuth token endpoint failure: Status: {response.StatusCode};Headers: {response.Headers};Body: {body};";
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Latency\ChecpointAcceptanceTests.cs (2)
110var h = response.Headers 129var timeHeaders = response.Headers.GetValues("Server-Timing").ToArray();
Microsoft.Extensions.Http (2)
Logging\LogHelper.cs (2)
96new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue), 135new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue),
Microsoft.Extensions.Http.Diagnostics (2)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
68AppendServerName(response.Headers, stringBuilder);
Logging\Internal\HttpHeadersReader.cs (1)
62ReadHeaders(response.Headers, _responseHeadersToLog, destination);
Microsoft.Extensions.Http.Diagnostics.Tests (24)
Latency\Internal\HttpClientLatencyLogEnricherTest.cs (1)
68httpResponseMessage.Headers.Add(TelemetryConstants.ServerApplicationNameHeader, serverName);
Logging\HttpClientLoggerTest.cs (9)
199httpResponseMessage.Headers.Add(TestResponseHeader, testResponseHeaderValue); 200httpResponseMessage.Headers.Add("Header3", testRequestHeaderValue); 293httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 402httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 499httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 613httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 614httpResponseMessage.Headers.TransferEncoding.Add(new("compress")); 884httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 885httpResponseMessage.Headers.TransferEncoding.Add(new("chunked"));
Logging\HttpClientLoggingExtensionsTest.cs (1)
419response.Headers.TryAddWithoutValidation(TelemetryConstants.ServerApplicationNameHeader, "TestServer");
Logging\HttpHeadersReaderTest.cs (6)
76httpResponse.Headers.Add("Header3", "Value.3"); 77httpResponse.Headers.Add("Header4", "Value.4"); 79httpResponse.Headers.Add("Header6", string.Empty); 80httpResponse.Headers.Add("Header7", "Value.7"); 146httpResponse.Headers.Add("Header3", "Value.3"); 147httpResponse.Headers.Add("Header4", "Value.4");
Logging\HttpRequestReaderTest.cs (7)
99httpResponseMessage.Headers.Add(header2.Key, header2.Value); 100httpResponseMessage.Headers.Add(header3.Key, header3.Value); 232httpResponseMessage.Headers.Add(header2.Key, header2.Value); 308httpResponseMessage.Headers.Add(header2.Key, header2.Value); 441httpResponseMessage.Headers.Add(header2.Key, header2.Value); 510httpResponseMessage.Headers.Add(header2.Key, header2.Value); 580httpResponseMessage.Headers.Add(header2.Key, header2.Value);
Microsoft.Extensions.Http.Resilience (1)
Internal\RetryAfterHelper.cs (1)
18var (parsed, delay) = response.Headers.RetryAfter switch
Microsoft.Extensions.Http.Resilience.Tests (3)
Internal\RetryAfterHelperTests.cs (3)
20response.Headers.RetryAfter = new RetryConditionHeaderValue(TimeSpan.FromSeconds(10)); 45response.Headers.RetryAfter = new RetryConditionHeaderValue(timeProvider.GetUtcNow() + TimeSpan.FromDays(1)); 59response.Headers.RetryAfter = new RetryConditionHeaderValue(timeProvider.GetUtcNow() + TimeSpan.FromDays(1));
Microsoft.Extensions.ML (3)
ModelLoaders\UriModelLoader.cs (3)
112return resp.Headers.GetValues(ETagHeader).First() == eTag; 149if (resp.Headers.Contains(ETagHeader)) 151_eTag = resp.Headers.GetValues(ETagHeader).First();
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
274var hasHeader = response.Headers.TryGetValues("content-length", out headers);
Microsoft.NET.Build.Containers (6)
AuthHandshakeMessageHandler.cs (1)
79var authenticateHeader = msg.Headers.WwwAuthenticate;
Registry\HttpExtensions.cs (4)
33if (response.Headers.Location is { IsAbsoluteUri: true }) 35return response.Headers.Location; 41return new Uri(response.RequestMessage!.RequestUri!, response.Headers.Location?.OriginalString ?? ""); 75s.AppendLine(response.Headers.ToString());
Registry\Registry.cs (1)
227initialManifestResponse.Headers.TryGetValues("Docker-Content-Digest", out var knownDigest);
Microsoft.NET.Sdk.Publish.Tasks (2)
Tasks\Http\HttpResponseMessageWrapper.cs (2)
37&& _message.Headers is not null 38&& _message.Headers.TryGetValues(name, out IEnumerable<string>? values))
Microsoft.TemplateSearch.Common (2)
Providers\NuGetMetadataSearchProvider.cs (2)
196if (response.Headers.TryGetValues(ETagHeaderName, out IEnumerable<string> etagValues)) 245foreach (KeyValuePair<string, IEnumerable<string>> header in response.Headers)
NuGet.Protocol (3)
HttpResponseMessageExtensions.cs (2)
24if (response.Headers.Contains(ProtocolConstants.ServerWarningHeader)) 26foreach (var warning in response.Headers.GetValues(ProtocolConstants.ServerWarningHeader))
HttpSource\HttpRetryHandler.cs (1)
196retryAfter = GetRetryAfter(response.Headers.RetryAfter);
System.Net.Http (13)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (2)
160response.Headers.ProxyAuthenticate : 161response.Headers.WwwAuthenticate;
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (2)
30if (!response.Headers.TryGetValues(KnownHeaders.ProxySupport.Descriptor, out IEnumerable<string>? values)) 68if (response.Headers.ConnectionClose.GetValueOrDefault())
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (2)
638if (_altSvcEnabled && response.Headers.TryGetValues(KnownHeaders.AltSvc.Descriptor, out IEnumerable<string>? altSvcHeaderValues)) 640HandleAltSvc(altSvcHeaderValues, response.Headers.Age);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (1)
14if (response.Headers.TryGetValues(KnownHeaders.SetCookie.Descriptor, out IEnumerable<string>? values))
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
724_response.Headers.TryAddWithoutValidation((descriptor.HeaderType & HttpHeaderType.Request) == HttpHeaderType.Request ? descriptor.AsCustomHeader() : descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
1149_response!.Headers.TryAddWithoutValidation(descriptor.HeaderType.HasFlag(HttpHeaderType.Request) ? descriptor.AsCustomHeader() : descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (3)
755if (response.Headers.ConnectionClose.GetValueOrDefault()) 811else if (response.Headers.TransferEncodingChunked == true) 1311headers = response.Headers;
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (1)
109Uri? location = response.Headers.Location;
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpHandler.cs (2)
1013state.RequestMessage.RequestUri.Scheme == Uri.UriSchemeHttps && responseMessage.Headers.Location?.Scheme == Uri.UriSchemeHttp) 1015NetEventSource.Error(this, $"Insecure https to http redirect from {state.RequestMessage.RequestUri} to {responseMessage.Headers.Location} blocked.");
System\Net\Http\WinHttpResponseParser.cs (1)
282HttpResponseHeaders responseHeaders = response.Headers;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
203foreach (var header in _httpResponseMessage.Headers)
System.ServiceModel.Http (3)
System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (2)
39MergeWebHeaderCollectionWithHttpHeaders(headersToMerge, responseMessage.Headers, responseMessage.Content.Headers); 44IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers = httpResponse.Headers;
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
386_httpResponseMessage.Headers.WwwAuthenticate.ToString());