1 write to Headers
Microsoft.Extensions.Http.Resilience.Tests (1)
Polly\HttpRetryStrategyOptionsTests.cs (1)
132Headers =
821 references to Headers
Aspire.Dashboard.Tests (26)
Integration\FrontendOpenIdConnectAuthTests.cs (1)
45var redirectedTo = response.Headers.Location;
Integration\OtlpCorsHttpServiceTests.cs (12)
64Assert.Equal("http://localhost:8000", responseMessage1.Headers.GetValues("Access-Control-Allow-Origin").Single()); 65Assert.Equal("POST", responseMessage1.Headers.GetValues("Access-Control-Allow-Methods").Single()); 66Assert.Equal("X-Requested-With", responseMessage1.Headers.GetValues("Access-Control-Allow-Headers").Single()); 78Assert.Equal("http://localhost:8001", responseMessage2.Headers.GetValues("Access-Control-Allow-Origin").Single()); 79Assert.Equal("POST", responseMessage2.Headers.GetValues("Access-Control-Allow-Methods").Single()); 80Assert.Equal("X-Requested-With", responseMessage2.Headers.GetValues("Access-Control-Allow-Headers").Single()); 105Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Origin")); 106Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Methods")); 107Assert.False(responseMessage.Headers.Contains("Access-Control-Allow-Headers")); 133Assert.Equal("*", responseMessage.Headers.GetValues("Access-Control-Allow-Origin").Single()); 134Assert.Equal("POST", responseMessage.Headers.GetValues("Access-Control-Allow-Methods").Single()); 135Assert.Equal("x-requested-with,x-custom,Content-Type", responseMessage.Headers.GetValues("Access-Control-Allow-Headers").Single());
Integration\OtlpHttpServiceTests.cs (5)
54Assert.False(responseMessage.Headers.Contains("content-security-policy")); 180Assert.False(responseMessage.Headers.Contains("content-security-policy")); 295Assert.False(responseMessage.Headers.Contains("content-security-policy")); 324Assert.False(responseMessage.Headers.Contains("content-security-policy")); 353Assert.False(responseMessage.Headers.Contains("content-security-policy"));
Integration\StartupTests.cs (2)
413Assert.False(responseMessage.Headers.Contains("content-security-policy")); 697Assert.NotEmpty(response.Headers.GetValues(HeaderNames.ContentSecurityPolicy).Single());
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);
AuthSamples.FunctionalTests (5)
ClaimsTransformTests.cs (1)
41Assert.Equal("http://localhost/account/login?ReturnUrl=%2FHome%2FMyClaims", response.Headers.Location.ToString());
IdentityExternalClaimsTests.cs (1)
41Assert.Equal("http://localhost/Account/Login?ReturnUrl=%2FMyClaims", response.Headers.Location.ToString());
StaticFilesAuthTests.cs (1)
39Assert.Equal("http://localhost/Account/Login?ReturnUrl=%2F" + scenario, response.Headers.Location.ToString());
TestAssert.cs (2)
70return responseMessage.Headers.Location; 88MapHeaders(response.Headers);
dotnet-openapi (1)
HttpClientWrapper.cs (1)
59if (_response.Headers.TryGetValues(BaseCommand.ContentDispositionHeaderName, out var disposition))
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());
IIS.FunctionalTests (9)
Http2TrailersResetTests.cs (1)
138Assert.Equal("TrailerName", response.Headers.Trailer.Single());
Http3Tests.cs (2)
73Assert.Equal(altsvc, response1.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 94Assert.Equal(altsvc, response2.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault());
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
213Assert.Equal(body, response.Headers.GetValues("BodyAsString").Single()); 519Assert.False(response.Headers.TryGetValues("EmptyHeader", out var headerValues)); 530Assert.True(response.Headers.TryGetValues("UnknownHeader", out var headerValues)); 536Assert.True(response.Headers.TryGetValues("MultiHeader", out headerValues)); 585Assert.DoesNotContain(response.Headers, h => h.Key.Equals("transfer-encoding", StringComparison.InvariantCultureIgnoreCase)); 592Assert.Equal("MyServer/7.8", response.Headers.Server.Single().Product.ToString());
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (1)
559await deploymentResult.HttpClient.RetryRequestAsync("/HelloWorld", r => r.Headers.Server.ToString().StartsWith("Microsoft", StringComparison.Ordinal));
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1437Assert.Equal(true, response.Headers.ConnectionClose);
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (1)
559await deploymentResult.HttpClient.RetryRequestAsync("/HelloWorld", r => r.Headers.Server.ToString().StartsWith("Microsoft", StringComparison.Ordinal));
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1437Assert.Equal(true, response.Headers.ConnectionClose);
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (1)
559await deploymentResult.HttpClient.RetryRequestAsync("/HelloWorld", r => r.Headers.Server.ToString().StartsWith("Microsoft", StringComparison.Ordinal));
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1437Assert.Equal(true, response.Headers.ConnectionClose);
IISExpress.FunctionalTests (16)
InProcess\AuthenticationTests.cs (4)
40Assert.Contains("NTLM", response.Headers.WwwAuthenticate.ToString()); 41Assert.Contains("Negotiate", response.Headers.WwwAuthenticate.ToString()); 46Assert.Contains("NTLM", response.Headers.WwwAuthenticate.ToString()); 48Assert.Contains("Negotiate", response.Headers.WwwAuthenticate.ToString());
OutOfProcess\NtlmAuthentationTest.cs (4)
59Assert.Contains("NTLM", response.Headers.WwwAuthenticate.ToString()); 60Assert.Contains("Negotiate", response.Headers.WwwAuthenticate.ToString()); 64Assert.Contains("NTLM", response.Headers.WwwAuthenticate.ToString()); 66Assert.Contains("Negotiate", response.Headers.WwwAuthenticate.ToString());
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
213Assert.Equal(body, response.Headers.GetValues("BodyAsString").Single()); 519Assert.False(response.Headers.TryGetValues("EmptyHeader", out var headerValues)); 530Assert.True(response.Headers.TryGetValues("UnknownHeader", out var headerValues)); 536Assert.True(response.Headers.TryGetValues("MultiHeader", out headerValues)); 585Assert.DoesNotContain(response.Headers, h => h.Key.Equals("transfer-encoding", StringComparison.InvariantCultureIgnoreCase)); 592Assert.Equal("MyServer/7.8", response.Headers.Server.Single().Product.ToString());
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (1)
559await deploymentResult.HttpClient.RetryRequestAsync("/HelloWorld", r => r.Headers.Server.ToString().StartsWith("Microsoft", StringComparison.Ordinal));
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1437Assert.Equal(true, response.Headers.ConnectionClose);
Interop.FunctionalTests (6)
Http2\Http2RequestTests.cs (2)
191Assert.Equal("abc", response.Headers.GetValues("test").Single()); 192Assert.Equal(longValue, response.Headers.GetValues(longKey).Single());
HttpClientHttp2InteropTests.cs (4)
537Assert.Equal("TestTrailer", response.Headers.Trailer.Single()); 569Assert.Equal("TestTrailer", response.Headers.Trailer.Single()); 684Assert.Equal("TestTrailer", response.Headers.Trailer.Single()); 1113Assert.Equal(oneKbString + i, response.Headers.GetValues("header" + i).Single());
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
238var errorMessage = $"OAuth token endpoint failure: Status: {response.StatusCode};Headers: {response.Headers};Body: {body};";
Microsoft.AspNetCore.Authentication.Test (233)
CookieTests.cs (24)
51var responded = transaction.Response.Headers.GetValues("Location"); 63var responded = transaction.Response.Headers.GetValues("Location"); 75var responded = transaction.Response.Headers.GetValues("Location"); 87var responded = transaction.Response.Headers.GetValues("Location"); 101var location = transaction.Response.Headers.Location; 146Assert.True(transaction.Response.Headers.CacheControl.NoCache); 147Assert.True(transaction.Response.Headers.CacheControl.NoStore); 148Assert.Equal("no-cache", transaction.Response.Headers.Pragma.ToString()); 279Assert.True(transaction.Response.Headers.CacheControl.NoCache); 280Assert.True(transaction.Response.Headers.CacheControl.NoStore); 281Assert.Equal("no-cache", transaction.Response.Headers.Pragma.ToString()); 1179var location = transaction.Response.Headers.Location; 1193var location = transaction.Response.Headers.Location; 1254var location = transaction.Response.Headers.Location; 1391var location = transaction.Response.Headers.Location; 1439var location = transaction.Response.Headers.Location; 1463var location = transaction.Response.Headers.Location; 1488var location = transaction.Response.Headers.Location; 1516Assert.Equal(redirectUrl, transaction.Response.Headers.Location.ToString()); 1561Assert.Equal("/ret_path_2", transaction.Response.Headers.Location.ToString()); 1607Assert.Equal("/redirect_test", transaction.Response.Headers.Location.ToString()); 1630var location = transaction.Response.Headers.Location; 1915if (transaction.Response.Headers.Contains("Set-Cookie")) 1917transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").SingleOrDefault();
FacebookTests.cs (10)
111var query = transaction.Response.Headers.Location.Query; 142Assert.Contains("scope=foo,bar", res.Headers.Location.Query); 174Assert.Contains("scope=baz,qux", res.Headers.Location.Query); 206Assert.Contains("scope=baz,qux", res.Headers.Location.Query); 232var location = transaction.Response.Headers.Location.AbsoluteUri; 265var location = transaction.Response.Headers.Location.AbsoluteUri; 300var location = transaction.Response.Headers.Location.AbsoluteUri; 367Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 435var locationUri = transaction.Response.Headers.Location; 449Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
GoogleTests.cs (24)
56var location = transaction.Response.Headers.Location; 152var query = transaction.Response.Headers.Location.Query; 190var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 242var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 298var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 335var query = transaction.Response.Headers.Location.Query; 402Assert.Equal("/error?FailureMessage=AccessDenied", transaction.Response.Headers.GetValues("Location").First()); 438Assert.Equal("https://example.com/custom-denied-page?rurl=http%3A%2F%2Fwww.google.com%2F", transaction.Response.Headers.GetValues("Location").First()); 481Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First()); 520Assert.Equal("/error?FailureMessage=itfailed" + UrlEncoder.Default.Encode(";Description=whyitfailed;Uri=https://example.com/fail"), transaction.Response.Headers.GetValues("Location").First()); 559Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 630transaction.Response.Headers.GetValues("Location").First()); 682transaction.Response.Headers.GetValues("Location").First()); 722Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 762Assert.Equal("/", transaction.Response.Headers.GetValues("Location").First()); 810Assert.Equal("/foo", transaction.Response.Headers.GetValues("Location").First()); 854transaction.Response.Headers.GetValues("Location").First()); 883Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 927Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 971Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1008Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1016Assert.StartsWith("https://www.facebook.com/", transaction.Response.Headers.Location.OriginalString); 1068var locationUri = transaction.Response.Headers.Location; 1082Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
JwtBearerTests.cs (9)
293Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 320Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 344Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 364Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 385response.Response.Headers.WwwAuthenticate.First().ToString()); 451Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 466Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 478Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 785Assert.Empty(response.Response.Headers.WwwAuthenticate);
JwtBearerTests_Handler.cs (9)
276Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 300Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 321Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 338Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 356response.Response.Headers.WwwAuthenticate.First().ToString()); 421Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 435Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 447Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 733Assert.Empty(response.Response.Headers.WwwAuthenticate);
MicrosoftAccountTests.cs (9)
66var query = transaction.Response.Headers.Location.Query; 120var location = transaction.Response.Headers.Location.AbsoluteUri; 146Assert.Contains("scope=foo%20bar", res.Headers.Location.Query); 164Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 182Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 244Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 270var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 335var locationUri = transaction.Response.Headers.Location; 349Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
OAuthTests.cs (12)
135Assert.NotNull(res.Headers.Location); 136var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 163Assert.NotNull(res.Headers.Location); 164var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 193Assert.Contains("scope=foo%20bar", res.Headers.Location.Query); 219Assert.Contains("prompt=login&audience=https%3A%2F%2Fapi.example.com", res.Headers.Location.Query); 248Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 277Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 314Assert.Equal("https://www.example.com/access-denied?ReturnUrl=http%3A%2F%2Ftesthost%2Fredirect", transaction.Response.Headers.Location.ToString()); 349Assert.Null(transaction.Response.Headers.Location); 385Assert.Null(transaction.Response.Headers.Location); 421Assert.Null(transaction.Response.Headers.Location);
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (1)
100Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First());
OpenIdConnect\OpenIdConnectChallengeTests.cs (57)
37Assert.NotNull(res.Headers.Location); 40res.Headers.Location, 70Assert.NotNull(res.Headers.Location); 74Assert.Contains("code_challenge=", res.Headers.Location.Query); 75Assert.Contains("code_challenge_method=S256", res.Headers.Location.Query); 79Assert.DoesNotContain("code_challenge=", res.Headers.Location.Query); 80Assert.DoesNotContain("code_challenge_method=", res.Headers.Location.Query); 105Assert.NotNull(res.Headers.Location); 107Assert.DoesNotContain("code_challenge=", res.Headers.Location.Query); 108Assert.DoesNotContain("code_challenge_method=", res.Headers.Location.Query); 126Assert.DoesNotContain(OpenIdConnectParameterNames.SkuTelemetry, res.Headers.Location.Query); 127Assert.DoesNotContain(OpenIdConnectParameterNames.VersionTelemetry, res.Headers.Location.Query); 198Assert.NotNull(res.Headers.Location); 200var values = settings.ValidateChallengeRedirect(res.Headers.Location); 233Assert.NotNull(res.Headers.Location); 235var values = settings.ValidateChallengeRedirect(res.Headers.Location); 276Assert.NotNull(res.Headers.Location); 279res.Headers.Location, 313Assert.NotNull(res.Headers.Location); 316res.Headers.Location, 322var actual = res.Headers.Location.Query.Trim('?').Split('&').Single(seg => seg.StartsWith($"{OpenIdConnectParameterNames.ClientId}=", StringComparison.Ordinal)); 357Assert.NotNull(res.Headers.Location); 361Assert.Equal(newMessage.TestAuthorizeEndpoint, res.Headers.Location.AbsoluteUri); 391Assert.Equal("Oolong", res.Headers.GetValues("tea").Single()); 392Assert.Null(res.Headers.Location); 421Assert.Null(res.Headers.Location); 491res.Headers.Location, 513res.Headers.Location, 533settings.ValidateChallengeRedirect(res.Headers.Location, OpenIdConnectParameterNames.Prompt); 534Assert.Contains("prompt=consent", res.Headers.Location.Query); 557settings.ValidateChallengeRedirect(res.Headers.Location); 558Assert.Contains("prompt=login", res.Headers.Location.Query); 579settings.ValidateChallengeRedirect(res.Headers.Location); 580Assert.Contains("prompt=login", res.Headers.Location.Query); 603settings.ValidateChallengeRedirect(res.Headers.Location); 604Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 627settings.ValidateChallengeRedirect(res.Headers.Location); 628Assert.Contains("scope=baz%20qux", res.Headers.Location.Query); 651settings.ValidateChallengeRedirect(res.Headers.Location); 652Assert.Contains("max_age=1234", res.Headers.Location.Query); 673settings.ValidateChallengeRedirect(res.Headers.Location); 674Assert.Contains("max_age=1234", res.Headers.Location.Query); 694settings.ValidateChallengeRedirect(res.Headers.Location); 695Assert.Contains("prompt=login&audience=https%3A%2F%2Fapi.example.com", res.Headers.Location.Query); 723Assert.Contains("request_uri=my_reference_value", res.Headers.Location.Query); 724Assert.Contains("client_id=Test%20Id", res.Headers.Location.Query); 727Assert.DoesNotContain("redirect_uri", res.Headers.Location.Query); 728Assert.DoesNotContain("scope", res.Headers.Location.Query); 729Assert.DoesNotContain("client_secret", res.Headers.Location.Query); 813Assert.DoesNotContain("request_uri=my_reference_value", res.Headers.Location.Query); 817Assert.Contains("redirect_uri", res.Headers.Location.Query); 818Assert.Contains("scope", res.Headers.Location.Query); 851Assert.Contains("request_uri=request_uri_from_event", res.Headers.Location.Query); 886Assert.DoesNotContain("scope", res.Headers.Location.Query); 917Assert.Contains("request_uri=my_reference_value", res.Headers.Location.Query); 918Assert.Contains("client_id=Test%20Id", res.Headers.Location.Query); 921Assert.DoesNotContain("prompt", res.Headers.Location.Query);
OpenIdConnect\OpenIdConnectEventTests.cs (8)
970Assert.Equal("http://testhost/end", response.Headers.Location.GetLeftPart(UriPartial.Path)); 997Assert.Null(response.Headers.Location); 1015Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1041Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1067Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1083Assert.Equal("http://testhost/redirect", response.Headers.Location.AbsoluteUri); 1106Assert.Null(response.Headers.Location); 1133Assert.Null(response.Headers.Location);
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (8)
970Assert.Equal("http://testhost/end", response.Headers.Location.GetLeftPart(UriPartial.Path)); 997Assert.Null(response.Headers.Location); 1015Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1041Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1067Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1083Assert.Equal("http://testhost/redirect", response.Headers.Location.AbsoluteUri); 1106Assert.Null(response.Headers.Location); 1133Assert.Null(response.Headers.Location);
OpenIdConnect\OpenIdConnectTests.cs (19)
51Assert.NotNull(res.Headers.Location); 54transaction.Response.Headers.Location, 78Assert.NotNull(res.Headers.Location); 79var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 105Assert.NotNull(res.Headers.Location); 106var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 131Assert.NotNull(res.Headers.Location); 132var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 158Assert.NotNull(res.Headers.Location); 159var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 183Assert.DoesNotContain(OpenIdConnectParameterNames.SkuTelemetry, res.Headers.Location.Query); 184Assert.DoesNotContain(OpenIdConnectParameterNames.VersionTelemetry, res.Headers.Location.Query); 185setting.ValidateSignoutRedirect(transaction.Response.Headers.Location); 220settings.ValidateSignoutRedirect(transaction.Response.Headers.Location, 242var query = transaction.Response.Headers.Location.Query.Substring(1).Split('&') 273var query = transaction.Response.Headers.Location.Query.Substring(1).Split('&') 321Assert.DoesNotContain(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie"); 345Assert.DoesNotContain(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie"); 369Assert.Contains(remoteSignOutTransaction.Response.Headers, h => h.Key == "Set-Cookie");
OpenIdConnect\TestServerExtensions.cs (2)
35if (transaction.Response.Headers.Contains("Set-Cookie")) 37transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
TestExtensions.cs (2)
30if (transaction.Response.Headers.Contains("Set-Cookie")) 32transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
TwitterTests.cs (11)
72var query = transaction.Response.Headers.Location.Query; 182var location = transaction.Response.Headers.Location.AbsoluteUri; 210var location = transaction.Response.Headers.Location.AbsoluteUri; 212Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 224Assert.Equal("http://localhost/access-denied?ReturnUrl=%2Fchallenge", response.Headers.Location.ToString()); 260var location = transaction.Response.Headers.Location.AbsoluteUri; 262Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 367var location = transaction.Response.Headers.Location.AbsoluteUri; 369Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 432Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 511Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
WsFederation\WsFederationTest.cs (14)
76Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 77var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 92Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 93var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 108Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 109var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 124var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 133request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 160var request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 175var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 194var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single(); 196Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single()); 234Assert.Contains("CustomKey=CustomValue", result.Headers.Location.Query); 264var cookies = SetCookieHeaderValue.ParseList(response.Headers.GetValues(HeaderNames.SetCookie).ToList());
WsFederation\WsFederationTest_Handler.cs (14)
74Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 75var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 90Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 91var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 106Assert.Equal("https://login.windows.net/4afbc689-805b-48cf-a24c-d4aa3248a248/wsfed", response.Headers.Location.GetLeftPart(System.UriPartial.Path)); 107var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 122var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 131request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 158var request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 173var queryItems = QueryHelpers.ParseQuery(response.Headers.Location.Query); 192var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single(); 194Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single()); 232Assert.Contains("CustomKey=CustomValue", result.Headers.Location.Query); 262var cookies = SetCookieHeaderValue.ParseList(response.Headers.GetValues(HeaderNames.SetCookie).ToList());
Microsoft.AspNetCore.CookiePolicy.Test (2)
TestExtensions.cs (2)
27if (transaction.Response.Headers.Contains("Set-Cookie")) 29transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
Microsoft.AspNetCore.Cors.Test (14)
CorsMiddlewareTests.cs (14)
57Assert.Single(response.Headers); 59Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault()); 99Assert.Equal(2, response.Headers.Count()); 101Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault()); 102Assert.Equal("AllowedHeader", response.Headers.GetValues(CorsConstants.AccessControlExposeHeaders).FirstOrDefault()); 150Assert.Single(response.Headers); 151Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault()); 201response.Headers.OrderBy(h => h.Key), 267response.Headers.OrderBy(h => h.Key), 328Assert.Empty(response.Headers); 370Assert.Empty(response.Headers); 488response.Headers.OrderBy(h => h.Key), 545response.Headers.OrderBy(o => o.Key), 623response.Headers.OrderBy(o => o.Key),
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (4)
HealthCheckMiddlewareTests.cs (4)
432Assert.Equal("no-store, no-cache", response.Headers.CacheControl.ToString()); 433Assert.Equal("no-cache", response.Headers.Pragma.ToString()); 467Assert.Null(response.Headers.CacheControl); 468Assert.Empty(response.Headers.Pragma.ToString());
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Latency\ChecpointAcceptanceTests.cs (2)
110var h = response.Headers 129var timeHeaders = response.Headers.GetValues("Server-Timing").ToArray();
Microsoft.AspNetCore.Diagnostics.Tests (20)
ExceptionHandlerTest.cs (19)
186Assert.True(response.Headers.CacheControl.NoCache); 187Assert.True(response.Headers.CacheControl.NoStore); 188Assert.True(response.Headers.TryGetValues("Pragma", out values)); 194Assert.False(response.Headers.TryGetValues("ETag", out values)); 242Assert.True(response.Headers.CacheControl.NoCache); 243Assert.True(response.Headers.CacheControl.NoStore); 244Assert.True(response.Headers.TryGetValues("Pragma", out values)); 250Assert.False(response.Headers.TryGetValues("ETag", out values)); 297Assert.True(response.Headers.TryGetValues("Cache-Control", out values)); 300Assert.True(response.Headers.TryGetValues("Pragma", out values)); 306Assert.True(response.Headers.TryGetValues("ETag", out values)); 369Assert.True(response.Headers.CacheControl.NoCache); 370Assert.True(response.Headers.CacheControl.NoStore); 371Assert.True(response.Headers.TryGetValues("Pragma", out values)); 374Assert.False(response.Headers.TryGetValues("Expires", out _)); 375Assert.False(response.Headers.TryGetValues("ETag", out _)); 439Assert.True(response.Headers.TryGetValues("Cache-Control", out values)); 442Assert.True(response.Headers.TryGetValues("Pragma", out values)); 448Assert.True(response.Headers.TryGetValues("ETag", out values));
StatusCodeMiddlewareTest.cs (1)
63Assert.Equal(expectedUri, response.Headers.First(s => s.Key == "Location").Value.First());
Microsoft.AspNetCore.FunctionalTests (3)
WebHostFunctionalTests.cs (3)
45Assert.Equal("Kestrel", response.Headers.Server.ToString()); 70Assert.Equal("Kestrel", response.Headers.Server.ToString()); 171Assert.Equal("Microsoft-IIS/10.0", response.Headers.Server.ToString());
Microsoft.AspNetCore.Http.Extensions.Tests (2)
HttpResponseJsonExtensionsTests.cs (2)
514var headerValue = Assert.Single(result.Headers.GetValues("Test")); 546var headerValue = Assert.Single(result.Headers.GetValues("Test"));
Microsoft.AspNetCore.HttpsPolicy.Tests (16)
HstsMiddlewareTests.cs (8)
71Assert.Equal("max-age=2592000", response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault()); 117Assert.Equal(expected, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault()); 163Assert.Equal(expected, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault()); 208Assert.Empty(response.Headers); 263Assert.Single(response.Headers); 318Assert.Empty(response.Headers); 365Assert.Empty(response.Headers); 411Assert.Contains(response.Headers, x => x.Key == HeaderNames.StrictTransportSecurity);
HttpsPolicyTests.cs (3)
70Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 73client.BaseAddress = new Uri(response.Headers.Location.ToString()); 77Assert.Equal(expectedHstsHeader, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault());
HttpsRedirectionMiddlewareTests.cs (5)
111Assert.Equal(expected, response.Headers.Location.ToString()); 167Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 228Assert.Equal(expectedUrl, response.Headers.Location.ToString()); 268Assert.Equal("https://localhost:5050/", response.Headers.Location.ToString()); 356Assert.Equal("https://localhost:5050/", response.Headers.Location.ToString());
Microsoft.AspNetCore.Identity.FunctionalTests (7)
Extensions\ResponseAssert.cs (2)
18return responseMessage.Headers.Location; 36MapHeaders(response.Headers);
MapIdentityApiTests.cs (5)
113Assert.False(loginResponse.Headers.Contains(HeaderNames.SetCookie)); 214Assert.True(loginResponse.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders)); 1148Assert.False(infoPostResponse.Headers.Contains(HeaderNames.SetCookie)); 1169Assert.False(emailConfirmationResponse.Headers.Contains(HeaderNames.SetCookie)); 1470Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders));
Microsoft.AspNetCore.Identity.InMemory.Test (2)
FunctionalTest.cs (2)
444if (transaction.Response.Headers.Contains("Set-Cookie")) 446transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").FirstOrDefault();
Microsoft.AspNetCore.Mvc.FunctionalTests (105)
AntiforgeryAuthTests.cs (2)
39Assert.Equal("/Home/Login", response.Headers.Location.AbsolutePath, StringComparer.OrdinalIgnoreCase); 51Assert.Equal("/Home/Login", response.Headers.Location.AbsolutePath, StringComparer.OrdinalIgnoreCase);
AntiforgeryTestHelper.cs (1)
24var setCookieArray = response.Headers.GetValues("Set-Cookie").ToArray();
AntiforgeryTests.cs (13)
38var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 41var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray(); 47Assert.True(response.Headers.CacheControl.NoCache); 48var pragmaValue = Assert.Single(response.Headers.Pragma.ToArray()); 93var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 96var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray(); 99Assert.True(response.Headers.CacheControl.NoCache); 100var pragmaValue = Assert.Single(response.Headers.Pragma.ToArray()); 172var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 175var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray(); 181Assert.True(response.Headers.CacheControl.NoCache); 182var pragmaValue = Assert.Single(response.Headers.Pragma.ToArray()); 210Assert.Equal("http://example.com/antiforgery-redirect", response.Headers.Location.AbsoluteUri);
ApplicationModelTest.cs (1)
175Assert.Equal("/Home/CannotBeRouted", response.Headers.Location.ToString());
AuthMiddlewareAndFilterTestBase.cs (4)
268Assert.Equal("/Account/Login", response.Headers.Location.LocalPath); 274Assert.Equal("/Account/AccessDenied", response.Headers.Location.LocalPath); 282Assert.True(response.Headers.Contains("Set-Cookie")); 283return response.Headers.GetValues("Set-Cookie").FirstOrDefault();
AuthMiddlewareUsingRequireAuthTest.cs (3)
76Assert.Equal("/Home/Login", response.Headers.Location.LocalPath); 84Assert.True(response.Headers.Contains("Set-Cookie")); 85return response.Headers.GetValues("Set-Cookie").FirstOrDefault();
BasicTests.cs (5)
165Assert.Equal("Hello, World!", Assert.Single(response.Headers.GetValues("Message"))); 194Assert.NotNull(response.Headers.Location); 195Assert.Equal("https://localhost/Home/HttpsOnlyAction", response.Headers.Location.ToString()); 408Assert.NotNull(response.Headers.Location); 409Assert.Equal("/Home/Product", response.Headers.Location.ToString());
ComponentRenderingFunctionalTests.cs (1)
76Assert.Equal("http://localhost/navigation-redirect", response.Headers.Location.ToString());
CorsTestsBase.cs (15)
54var responseHeaders = response.Headers; 55var header = Assert.Single(response.Headers); 73Assert.Empty(response.Headers); 91Assert.Empty(response.Headers); 133response.Headers.OrderBy(h => h.Key), 167var responseHeaders = response.Headers; 200var responseHeaders = response.Headers; 233Assert.Empty(response.Headers); 259Assert.Empty(response.Headers); 286Assert.Empty(response.Headers); 310var responseHeaders = response.Headers; 342var responseHeaders = response.Headers; 381Assert.Empty(response.Headers); 404Assert.Empty(response.Headers); 424Assert.Empty(response.Headers);
FiltersTest.cs (1)
125Assert.Equal(new[] { "True" }, response.Headers.GetValues("X-ServiceActionFilter"));
GlobalAuthorizationFilterTestBase.cs (5)
42Assert.NotNull(response.Headers.Location); 45response.Headers.Location.ToString()); 68Assert.True(response.Headers.Contains("Set-Cookie")); 71var cookie2 = response.Headers.GetValues("Set-Cookie").SingleOrDefault(); 80Assert.Null(response.Headers.Location);
Infrastructure\HttpClientExtensions.cs (1)
42string responseContent = string.Join(Environment.NewLine, response.Headers);
LinkGenerationTests.cs (1)
69response.Headers.Location);
RazorPagesTest.cs (20)
508request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 533request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 558request = new HttpRequestMessage(HttpMethod.Get, response.Headers.Location); 618Assert.Equal("/Login?ReturnUrl=%2FHelloWorldWithAuth", response.Headers.Location.PathAndQuery); 961Assert.Equal(expected, response.Headers.Location.ToString()); 975Assert.Equal(expected, response.Headers.Location.ToString()); 997Assert.Equal(expected, response.Headers.Location.ToString()); 1011Assert.Equal(expected, response.Headers.Location.ToString()); 1025Assert.Equal(expected, response.Headers.Location.ToString()); 1039Assert.Equal(expected, response.Headers.Location.ToString()); 1053Assert.Equal(expected, response.Headers.Location.ToString()); 1065Assert.Equal(expected, response.Headers.Location.ToString()); 1077Assert.Equal(expected, response.Headers.Location.ToString()); 1089Assert.Equal(expected, response.Headers.Location.ToString()); 1103Assert.Equal(expected, response.Headers.Location.ToString()); 1115Assert.Equal(expected, response.Headers.Location.ToString()); 1214Assert.Equal("/Login?ReturnUrl=%2FPages%2FModelWithAuthFilter", response.Headers.Location.PathAndQuery); 1225Assert.Equal("/Login?ReturnUrl=%2FPages%2FAdmin%2FEdit", response.Headers.Location.PathAndQuery); 1252var cacheControl = response.Headers.CacheControl; 1513var setCookie = response.Headers.GetValues("Set-Cookie").ToArray();
RazorPagesWithBasePathTest.cs (10)
114Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuth", response.Headers.Location.PathAndQuery); 125Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuthFolder", response.Headers.Location.PathAndQuery); 260Assert.Equal(expected, response.Headers.Location.ToString()); 274Assert.Equal(expected, response.Headers.Location.ToString()); 393Assert.Equal("/Login?ReturnUrl=%2FAccounts%2FRequiresAuth", response.Headers.Location.PathAndQuery); 478Assert.Equal("/", response.Headers.Location.ToString()); 727Assert.Equal("/Login?ReturnUrl=%2FFilters%2FAuthFilterOnPage", response.Headers.Location.PathAndQuery); 738Assert.Equal("/Login?ReturnUrl=%2FFilters%2FAuthFilterOnPageWithModel", response.Headers.Location.PathAndQuery); 749Assert.Equal(new[] { "PageModelFilterValue" }, response.Headers.GetValues("PageModelFilterKey")); 750Assert.Equal(new[] { "PageFilterValue" }, response.Headers.GetValues("PageFilterKey"));
RazorPagesWithEndpointRoutingTest.cs (3)
38Assert.Equal("/Login?ReturnUrl=%2FConventions%2FAuthFolder", response.Headers.Location.PathAndQuery); 62Assert.Equal("/Login?ReturnUrl=%2FModelWithAuthFilter", response.Headers.Location.PathAndQuery); 73Assert.Equal("/Login?ReturnUrl=%2FAuthorizedAction%2FIndex", response.Headers.Location.PathAndQuery);
SimpleWithWebApplicationBuilderTests.cs (2)
93Assert.Equal("/ok-object", response.Headers.Location.ToString()); 120Assert.Equal("/json", response.Headers.Location.ToString());
SystemTextJsonOutputFormatterTest.cs (1)
82var headerValue = Assert.Single(response.Headers.GetValues("Test"));
TempDataInCookiesTest.cs (6)
69Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues)); 95Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out setCookieValues)); 128Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues)); 145response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), response)); 151Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out setCookieValues)); 181Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues));
TempDataInCookiesUsingCookieConsentTest.cs (1)
110if (response.Headers.TryGetValues("Set-Cookie", out values))
TempDataPropertyTest.cs (3)
51var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse)); 79var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse)); 163if (response.Headers.TryGetValues("Set-Cookie", out var values))
TempDataTestBase.cs (3)
108response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), response)); 173var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse)); 266if (response.Headers.TryGetValues("Set-Cookie", out values))
TestingInfrastructureTests.cs (3)
65var xPassThruValue = Assert.Single(response.Headers.GetValues("X-Pass-Thru")); 88var xPassThruValue = Assert.Single(response.Headers.GetValues("X-Pass-Thru")); 123Assert.Equal("/Testing/Builder", response.Headers.Location?.OriginalString);
Microsoft.AspNetCore.Mvc.Testing (2)
Handlers\CookieContainerHandler.cs (1)
52if (response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders))
Handlers\RedirectHandler.cs (1)
139var location = response.Headers.Location;
Microsoft.AspNetCore.OutputCaching.Tests (16)
OutputCacheTests.cs (16)
1041Assert.Equal(initialResponse.Headers.CacheControl, subsequentResponse.Headers.CacheControl); 1043Assert.Equal(initialResponse.Headers.Date, subsequentResponse.Headers.Date); 1044Assert.Equal(initialResponse.Headers.ETag, subsequentResponse.Headers.ETag); 1046Assert.Equal(initialResponse.Headers.Vary, subsequentResponse.Headers.Vary); 1054foreach (var header in initialResponse.Headers) 1056Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key)); 1058Assert.True(subsequentResponse.Headers.Contains(HeaderNames.Age)); 1067Assert.False(subsequentResponse.Headers.Contains(HeaderNames.Age)); 1072Assert.True(initialResponse.Headers.Contains("X-Value")); 1073Assert.NotEqual(initialResponse.Headers.GetValues("X-Value"), subsequentResponse.Headers.GetValues("X-Value"));
Microsoft.AspNetCore.ResponseCaching.Tests (16)
ResponseCachingTests.cs (16)
945Assert.Equal(initialResponse.Headers.CacheControl, subsequentResponse.Headers.CacheControl); 947Assert.Equal(initialResponse.Headers.Date, subsequentResponse.Headers.Date); 948Assert.Equal(initialResponse.Headers.ETag, subsequentResponse.Headers.ETag); 950Assert.Equal(initialResponse.Headers.Vary, subsequentResponse.Headers.Vary); 958foreach (var header in initialResponse.Headers) 960Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key)); 962Assert.True(subsequentResponse.Headers.Contains(HeaderNames.Age)); 971Assert.False(subsequentResponse.Headers.Contains(HeaderNames.Age)); 976Assert.True(initialResponse.Headers.Contains("X-Value")); 977Assert.NotEqual(initialResponse.Headers.GetValues("X-Value"), subsequentResponse.Headers.GetValues("X-Value"));
Microsoft.AspNetCore.ResponseCompression.Tests (3)
ResponseCompressionMiddlewareTest.cs (3)
1292foreach (var value in response.Headers.GetValues(HeaderNames.Vary)) 1311foreach (var value in response.Headers.GetValues(HeaderNames.Vary)) 1323Assert.False(response.Headers.Contains(HeaderNames.Vary));
Microsoft.AspNetCore.Rewrite.Tests (37)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (4)
353Assert.Equal(@"https://www.example.com/foo/", response.Headers.Location.AbsoluteUri); 381Assert.Equal("/", response.Headers.Location.OriginalString); 435Assert.Equal("/foo", response.Headers.Location.OriginalString); 464Assert.Equal("http://localhost:80/home/report/123", response.Headers.Location.OriginalString);
IISUrlRewrite\MiddleWareTests.cs (10)
47Assert.Equal("/article.aspx?id=10&title=hey", response.Headers.Location.OriginalString); 147Assert.Equal("/hello", response.Headers.Location.OriginalString); 182Assert.Equal("/hey/hello", response.Headers.Location.OriginalString); 217Assert.Equal("/hey/hello/", response.Headers.Location.OriginalString); 251Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 365Assert.Equal("/", response.Headers.Location.OriginalString); 434Assert.Equal("/foo", response.Headers.Location.OriginalString); 472Assert.Equal("/hey/hello/", response.Headers.Location.OriginalString); 508Assert.Equal("/blogposts/article/abc?p1=123&p2=abc", response.Headers.Location.OriginalString); 544Assert.Equal("/blog/article/23/abc?p1=123&p2=abc", response.Headers.Location.OriginalString);
MiddlewareTests.cs (23)
174Assert.Equal(expectedUrl, response.Headers.Location.OriginalString); 204Assert.Equal("http://example.com/foo", response.Headers.Location.OriginalString); 228Assert.Equal("http://example.com/foo?bar=1", response.Headers.Location.OriginalString); 256Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 285Assert.Equal($"https://example.com:{sslPort.GetValueOrDefault().ToString(CultureInfo.InvariantCulture)}/", response.Headers.Location.OriginalString); 289Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 329Assert.Equal("https://" + expectedHostPathAndQuery, response.Headers.Location.OriginalString); 359Assert.Equal(redirectReplacement, response.Headers.Location.OriginalString); 383Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 410Assert.Equal(expected, response.Headers.Location.OriginalString); 439Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 468Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 493Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 528Assert.Null(response.Headers.Location); 556Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 585Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 610Assert.Equal("https://example.com/", response.Headers.Location.OriginalString); 634Assert.Equal("/", response.Headers.Location.OriginalString); 726Assert.Equal("/foo", response.Headers.Location.OriginalString); 755Assert.Null(response.Headers.Location); 783Assert.Equal(redirectUri, response.Headers.Location.OriginalString); 808Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString); 837Assert.Equal("https://www.example.com/", response.Headers.Location.OriginalString);
Microsoft.AspNetCore.Routing.FunctionalTests (4)
ShortCircuitTests.cs (4)
54Assert.True(response.Headers.Contains("Set")); 55Assert.False(response.Headers.Contains("NotSet")); 92Assert.False(response1.Headers.Contains("NotSet")); 96Assert.False(response2.Headers.Contains("NotSet"));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (111)
AuthenticationTests.cs (12)
40Assert.Empty(response.Headers.WwwAuthenticate); 58Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase); 80Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase); 106Assert.Equal("Negotiate, NTLM, basic", response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase); 215Assert.Empty(response.Headers.WwwAuthenticate); 260Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count); 283Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count); 301Assert.Equal(3, response.Headers.WwwAuthenticate.Count); 327Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count); 345Assert.Empty(response.Headers.WwwAuthenticate); 366Assert.Single(response.Headers.WwwAuthenticate); 367Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.First().Scheme);
Http3Tests.cs (2)
81Assert.Equal(altsvc, response1.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 118Assert.Equal(altsvc, response2.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault());
Listener\AuthenticationOnExistingQueueTests.cs (4)
70Assert.Empty(response.Headers.WwwAuthenticate); 88Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase); 112Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase); 137Assert.Equal("Negotiate, NTLM, basic", response.Headers.WwwAuthenticate.ToString(), StringComparer.OrdinalIgnoreCase);
Listener\ResponseBodyTests.cs (3)
47Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked"); 71Assert.True(response.Headers.TransferEncodingChunked.HasValue); 96Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked");
Listener\ResponseHeaderTests.cs (34)
40Assert.Equal(2, response.Headers.Count()); 41Assert.False(response.Headers.TransferEncodingChunked.HasValue); 42Assert.True(response.Headers.Date.HasValue); 43Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 62Assert.Equal(3, response.Headers.Count()); 63Assert.False(response.Headers.TransferEncodingChunked.HasValue); 64Assert.True(response.Headers.ConnectionClose.Value); 65Assert.True(response.Headers.Date.HasValue); 66Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 85Assert.Equal(2, response.Headers.Count()); 86Assert.False(response.Headers.TransferEncodingChunked.HasValue); 87Assert.True(response.Headers.Date.HasValue); 88Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 113Assert.Equal(3, response.Headers.Count()); 114Assert.False(response.Headers.TransferEncodingChunked.HasValue); 115Assert.True(response.Headers.ConnectionClose.Value); 116Assert.True(response.Headers.Date.HasValue); 117Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 143Assert.Equal(2, response.Headers.Count()); 144Assert.False(response.Headers.TransferEncodingChunked.HasValue); 145Assert.True(response.Headers.Date.HasValue); 146Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 172Assert.Equal(2, response.Headers.Count()); 173Assert.False(response.Headers.TransferEncodingChunked.HasValue); 174Assert.True(response.Headers.Date.HasValue); 175Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 195Assert.Equal(2, response.Headers.Count()); 196Assert.False(response.Headers.TransferEncodingChunked.HasValue); 197Assert.True(response.Headers.Date.HasValue); 198Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 235Assert.Null(response.Headers.ConnectionClose); 245Assert.Null(response.Headers.ConnectionClose); 270Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 271Assert.True(response.Headers.ConnectionClose.Value);
OpaqueUpgradeTests.cs (3)
41Assert.False(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 69Assert.False(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 100Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked");
ResponseBodyTests.cs (10)
37Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 124Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 156Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 181Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked"); 203Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked"); 228Assert.Null(response.Headers.TransferEncodingChunked); 308Assert.Null(response.Headers.TransferEncodingChunked); 339Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 367Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 394Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked");
ResponseCachingTests.cs (2)
480return response.Headers.GetValues("x-request-count").FirstOrDefault(); 491return response.Headers.GetValues("x-request-count").FirstOrDefault();
ResponseHeaderTests.cs (28)
31Assert.Equal(2, response.Headers.Count()); 32Assert.False(response.Headers.TransferEncodingChunked.HasValue); 33Assert.True(response.Headers.Date.HasValue); 34Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers.Server.ToString()); 132Assert.True(response.Headers.TryGetValues("Custom-Header1", out var header)); 151Assert.True(response.Headers.ConnectionClose.Value); 152Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 153Assert.True(response.Headers.TransferEncodingChunked.HasValue); 154Assert.True(response.Headers.TransferEncodingChunked); 177Assert.True(response.Headers.ConnectionClose.Value); 178Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 179Assert.False(response.Headers.TransferEncodingChunked.HasValue); 204Assert.True(response.Headers.TransferEncodingChunked.HasValue); 206Assert.True(response.Headers.ConnectionClose.Value); 207Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 235Assert.Equal(5, response.Headers.Count()); // Date, Server, Chunked 237Assert.Equal(2, response.Headers.GetValues("Custom1").Count()); 238Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 239Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 240Assert.Single(response.Headers.GetValues("Custom2")); 241Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First()); 265Assert.Equal(5, response.Headers.Count()); // Date, Server, Chunked 267Assert.Equal(2, response.Headers.GetValues("Custom1").Count()); 268Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 269Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 270Assert.Single(response.Headers.GetValues("Custom2")); 271Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First()); 288var headers = response.Headers;
ResponseSendFileTests.cs (11)
75Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked"); 94Assert.True(response.Headers.TransferEncodingChunked.Value, "Chunked"); 113Assert.True(response.Headers.TransferEncodingChunked.Value); 133Assert.True(response.Headers.TransferEncodingChunked.Value); 152Assert.True(response.Headers.TransferEncodingChunked.Value); 209Assert.True(response.Headers.TransferEncodingChunked.Value); 230Assert.Null(response.Headers.TransferEncodingChunked); 251Assert.Null(response.Headers.TransferEncodingChunked); 272Assert.Null(response.Headers.TransferEncodingChunked); 300Assert.True(response.Headers.TransferEncodingChunked.HasValue, "Chunked"); 323Assert.True(response.Headers.TransferEncodingChunked.HasValue);
ResponseTrailersTests.cs (2)
191Assert.Equal("TrailerName", response.Headers.Trailer.Single()); 217Assert.Equal("TrailerName", response.Headers.Trailer.Single());
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
WebHostTests.cs (4)
256Assert.True(response1.Headers.TryGetValues("alt-svc", out var altSvcValues1)); 270Assert.True(response2.Headers.TryGetValues("alt-svc", out var altSvcValues2)); 327Assert.False(response1.Headers.Contains("alt-svc")); 340Assert.False(response2.Headers.Contains("alt-svc"));
Microsoft.AspNetCore.Session.Tests (8)
SessionTests.cs (8)
57Assert.False(response.Headers.TryGetValues("Set-Cookie", out var _)); 94Assert.True(response.Headers.TryGetValues("Set-Cookie", out var values)); 149Assert.True(response.Headers.TryGetValues("Set-Cookie", out var values)); 203var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 263var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 321var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 425var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 494var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First();
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxy.cs (1)
168foreach (var header in responseMessage.Headers)
Microsoft.AspNetCore.StaticAssets.Tests (18)
StaticAssetsIntegrationTests.cs (18)
64Assert.Equal($"\"{GetEtag("Hello, World!")}\"", response.Headers.ETag.Tag); 114Assert.Equal($"\"{GetEtag("Hello, World!")}\"", response.Headers.ETag.Tag); 118Assert.True(response.Headers.CacheControl.NoCache); 166Assert.Equal($"\"{GetEtag("Hello, World!")}\"", response.Headers.ETag.Tag); 170Assert.Equal("immutable", response.Headers.CacheControl.ToString()); 335Assert.Equal($"\"3/1gIbsr1bCvZ2KQgJ7DpTGR3YHH9wpLKGiKNiGCmG8=\"", response.Headers.ETag.Tag); 388Assert.Equal($"\"+fvSyRQcr4/t/rcA0u1KfZ8c3CpXxBDxsxDhnAftNqg=\"", response.Headers.ETag.Tag); 444Assert.Equal(GetGzipEtag(Path.Combine(webRoot, "sample.txt")), response.Headers.ETag.Tag); 625Assert.NotNull(response.Headers.ETag); 626Assert.NotNull(response.Headers.ETag.Tag); 635Assert.Equal(response2.Headers.ETag, response1.Headers.ETag); 665req.Headers.Add("If-Match", original.Headers.ETag.ToString()); 714req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); 740req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); 787req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); 801var etag = resp1.Headers.ETag.ToString(); 835req3.Headers.IfNoneMatch.Add(resp1.Headers.ETag);
Microsoft.AspNetCore.StaticFiles.Tests (26)
CacheHeaderTests.cs (10)
21Assert.NotNull(response.Headers.ETag); 22Assert.NotNull(response.Headers.ETag.Tag); 33Assert.Equal(response2.Headers.ETag, response1.Headers.ETag); 65req.Headers.Add("If-Match", original.Headers.ETag.ToString()); 117req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); 145req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); 196.AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) 212var etag = resp1.Headers.ETag.ToString(); 251.AddHeader("If-None-Match", resp1.Headers.ETag.ToString())
DefaultFilesMiddlewareTests.cs (1)
267var actualURL = response.Headers.GetValues("Location").FirstOrDefault();
DirectoryBrowserMiddlewareTests.cs (1)
272Assert.Equal("http://localhost" + requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
RangeHeaderTests.cs (6)
24req.Headers.Add("If-Range", original.Headers.ETag.ToString()); 45req.Headers.Add("If-Range", original.Headers.ETag.ToString()); 50Assert.Equal(original.Headers.ETag, resp.Headers.ETag); 211req.Headers.Add("If-Range", original.Headers.ETag.ToString()); 238req.Headers.Add("If-Range", original.Headers.ETag.ToString());
StaticFileMiddlewareTests.cs (8)
41Assert.Null(response.Headers.ETag); 75Assert.Null(response.Headers.ETag); 115Assert.Null(response.Headers.ETag); 193Assert.NotNull(response.Headers.ETag); 232Assert.NotNull(response.Headers.ETag); 274Assert.NotNull(response.Headers.ETag); 324Assert.NotNull(response.Headers.ETag); 367Assert.NotNull(response.Headers.ETag);
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
221if (!response.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value))
Microsoft.AspNetCore.TestHost.Tests (10)
ClientHandlerTests.cs (8)
364Assert.Equal("TestValue:1", response.Headers.GetValues("TestHeader").First()); 367Assert.Equal("TestValue:2", response.Headers.GetValues("TestHeader").First()); 380Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 416Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 435Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 453Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 475Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 534Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First());
TestClientTests.cs (2)
438Assert.Equal("true", response.Headers.GetValues("test-header").Single()); 485Assert.Equal("true", response.Headers.GetValues("test-header").Single());
Microsoft.AspNetCore.WebSockets.Tests (3)
WebSocketCompressionMiddlewareTests.cs (3)
41Assert.Equal("permessage-deflate; server_no_context_takeover", response.Headers.GetValues(HeaderNames.SecWebSocketExtensions).Aggregate((l, r) => $"{l}; {r}")); 69Assert.False(response.Headers.Contains(HeaderNames.SecWebSocketExtensions)); 103Assert.Equal(expectedResponse, response.Headers.GetValues(HeaderNames.SecWebSocketExtensions).Aggregate((l, r) => $"{l}; {r}"));
Microsoft.DotNet.Build.Tasks.Feed (2)
src\common\AzureStorageUtils.cs (2)
260bool md5HeaderAvailable = response.Headers.TryGetValues("Content-MD5", out var md5); 261bool lengthHeaderAvailable = response.Headers.TryGetValues("Content-Length", out var contentLength);
Microsoft.DotNet.VersionTools (1)
Automation\GitHubApi\GitHubClient.cs (1)
452if (response.Headers.TryGetValues(headerName, out headerValues))
Microsoft.Extensions.Http (2)
Logging\LogHelper.cs (2)
123new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue), 162new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue),
Microsoft.Extensions.Http.Diagnostics (2)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
45AppendServerName(response.Headers, stringBuilder);
Logging\Internal\HttpHeadersReader.cs (1)
62ReadHeaders(response.Headers, _responseHeadersToLog, destination);
Microsoft.Extensions.Http.Diagnostics.Tests (23)
Latency\Internal\HttpClientLatencyLogEnricherTest.cs (1)
67httpResponseMessage.Headers.Add(TelemetryConstants.ServerApplicationNameHeader, serverName);
Logging\HttpClientLoggerTest.cs (9)
199httpResponseMessage.Headers.Add(TestResponseHeader, testResponseHeaderValue); 200httpResponseMessage.Headers.Add("Header3", testRequestHeaderValue); 292httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 399httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 495httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 608httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 609httpResponseMessage.Headers.TransferEncoding.Add(new("compress")); 878httpResponseMessage.Headers.Add(TestResponseHeader, responseHeaderValue); 879httpResponseMessage.Headers.TransferEncoding.Add(new("chunked"));
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)
96httpResponseMessage.Headers.Add(header2.Key, header2.Value); 97httpResponseMessage.Headers.Add(header3.Key, header3.Value); 225httpResponseMessage.Headers.Add(header2.Key, header2.Value); 300httpResponseMessage.Headers.Add(header2.Key, header2.Value); 430httpResponseMessage.Headers.Add(header2.Key, header2.Value); 497httpResponseMessage.Headers.Add(header2.Key, header2.Value); 565httpResponseMessage.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);
Negotiate.Client (3)
Controllers\AuthTestController.cs (3)
64var authHeader = result.Headers.WwwAuthenticate.ToString(); 212var authHeader = result.Headers.WwwAuthenticate.ToString(); 249var authHeader = result.Headers.WwwAuthenticate.ToString();
ServerComparison.FunctionalTests (16)
HelloWorldTest.cs (1)
84var serverHeader = response.Headers.Server.ToString();
NtlmAuthenticationTest.cs (3)
72Assert.DoesNotContain("NTLM", response.Headers.WwwAuthenticate.ToString()); 76Assert.Contains("NTLM", response.Headers.WwwAuthenticate.ToString()); 78Assert.Contains("Negotiate", response.Headers.WwwAuthenticate.ToString());
ResponseTests.cs (12)
139Assert.Null(response.Headers.TransferEncodingChunked); 140Assert.Null(response.Headers.ConnectionClose); 159Assert.True(response.Headers.ConnectionClose, "/connectionclose, closed?"); 160Assert.True(response.Headers.TransferEncodingChunked); 184Assert.True(response.Headers.ConnectionClose, "/connectionclose, closed?"); 185Assert.Null(response.Headers.TransferEncodingChunked); 209Assert.True(response.Headers.TransferEncodingChunked, "/chunked, chunked?"); 210Assert.Null(response.Headers.ConnectionClose); 234Assert.True(response.Headers.TransferEncodingChunked, "/manuallychunked, chunked?"); 235Assert.Null(response.Headers.ConnectionClose); 254Assert.True(response.Headers.TransferEncodingChunked, "/manuallychunkedandclose, chunked?"); 255Assert.True(response.Headers.ConnectionClose, "/manuallychunkedandclose, closed?");
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
130var headers = response.Headers;
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)
60if (!response.Headers.TryGetValues(KnownHeaders.ProxySupport.Descriptor, out IEnumerable<string>? values)) 98if (response.Headers.ConnectionClose.GetValueOrDefault())
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (2)
637if (_altSvcEnabled && response.Headers.TryGetValues(KnownHeaders.AltSvc.Descriptor, out IEnumerable<string>? altSvcHeaderValues)) 639HandleAltSvc(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)
1094_response!.Headers.TryAddWithoutValidation(descriptor.HeaderType.HasFlag(HttpHeaderType.Request) ? descriptor.AsCustomHeader() : descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (3)
753if (response.Headers.ConnectionClose.GetValueOrDefault()) 809else if (response.Headers.TransferEncodingChunked == true) 1309headers = response.Headers;
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (1)
107Uri? location = response.Headers.Location;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
203foreach (var header in _httpResponseMessage.Headers)
System.Net.WebSockets.Client (6)
System\Net\WebSockets\WebSocketHandle.Managed.cs (6)
150if (response.Headers.TryGetValues(HttpKnownHeaderNames.SecWebSocketProtocol, out IEnumerable<string>? subprotocolEnumerableValues)) 180if (options.DangerousDeflateOptions is not null && response.Headers.TryGetValues(HttpKnownHeaderNames.SecWebSocketExtensions, out IEnumerable<string>? extensions)) 231HttpResponseHeaders = new HttpResponseHeadersReadOnlyCollection(response.Headers); 461ValidateHeader(response.Headers, HttpKnownHeaderNames.Connection, "Upgrade"); 462ValidateHeader(response.Headers, HttpKnownHeaderNames.Upgrade, "websocket"); 463ValidateHeader(response.Headers, HttpKnownHeaderNames.SecWebSocketAccept, secValue);