2 writes to DefaultRequestHeaders
Microsoft.DotNet.Build.Tasks.Feed (1)
src\AzureDevOpsNugetFeedAssetPublisher.cs (1)
51DefaultRequestHeaders =
Microsoft.DotNet.Helix.Sdk (1)
AzureDevOpsTask.cs (1)
62DefaultRequestHeaders =
189 references to DefaultRequestHeaders
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
176client.DefaultRequestHeaders.Add("x-session-id", Guid.NewGuid().ToString());
IIS.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
136client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); 137client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("identity", 0)); 138client.DefaultRequestHeaders.Add("Response-Content-Type", "text/event-stream");
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (3)
145deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath); 166deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", originalANCMPath); 182deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath);
IISExpress.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
136client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); 137client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("identity", 0)); 138client.DefaultRequestHeaders.Add("Response-Content-Type", "text/event-stream");
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (3)
145deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath); 166deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", originalANCMPath); 182deploymentResult.HttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath);
Interop.FunctionalTests (7)
HttpClientHttp2InteropTests.cs (7)
89client.DefaultRequestHeaders.ExpectContinue = true; 175client.DefaultRequestHeaders.ExpectContinue = true; 295client.DefaultRequestHeaders.ExpectContinue = true; 372client.DefaultRequestHeaders.ExpectContinue = true; 432client.DefaultRequestHeaders.ExpectContinue = true; 731client.DefaultRequestHeaders.ExpectContinue = true; 840client.DefaultRequestHeaders.ExpectContinue = true;
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerPostConfigureOptions.cs (1)
55options.Backchannel.DefaultRequestHeaders.UserAgent.ParseAdd("Microsoft ASP.NET Core JwtBearer handler");
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthPostConfigureOptions.cs (1)
39options.Backchannel.DefaultRequestHeaders.UserAgent.ParseAdd("Microsoft ASP.NET Core OAuth handler");
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectPostConfigureOptions.cs (1)
71options.Backchannel.DefaultRequestHeaders.UserAgent.ParseAdd("Microsoft ASP.NET Core OpenIdConnect handler");
Microsoft.AspNetCore.Authentication.Test (6)
CertificateTests.cs (4)
395client.DefaultRequestHeaders.Add("X-Client-Cert", Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData)); 412client.DefaultRequestHeaders.Add("X-Client-Cert", "OOPS" + Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData)); 431client.DefaultRequestHeaders.Add("X-ARR-ClientCert", Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData)); 449client.DefaultRequestHeaders.Add("random-Weird-header", Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData));
OpenIdConnect\OpenIdConnectEventTests.cs (1)
1312client.DefaultRequestHeaders.Add("Cookie", cookie);
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
1310client.DefaultRequestHeaders.Add("Cookie", cookie);
Microsoft.AspNetCore.Authentication.Twitter (3)
TwitterPostConfigureOptions.cs (3)
51options.Backchannel.DefaultRequestHeaders.Accept.ParseAdd("*/*"); 52options.Backchannel.DefaultRequestHeaders.UserAgent.ParseAdd("Microsoft ASP.NET Core Twitter handler"); 53options.Backchannel.DefaultRequestHeaders.ExpectContinue = false;
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationPostConfigureOptions.cs (1)
66options.Backchannel.DefaultRequestHeaders.UserAgent.ParseAdd("Microsoft ASP.NET Core WsFederation handler");
Microsoft.AspNetCore.Diagnostics.Tests (2)
DeveloperExceptionPageMiddlewareTest.cs (2)
254client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html")); 329client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));
Microsoft.AspNetCore.Http.Connections.Client (9)
HttpConnection.cs (9)
649httpClient.DefaultRequestHeaders.Remove(header.Key); 651else if (httpClient.DefaultRequestHeaders.Contains(header.Key)) 653httpClient.DefaultRequestHeaders.Remove(header.Key); 654httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 658httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 663httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); 673httpClient.DefaultRequestHeaders.Add(Constants.UserAgent, Constants.UserAgentHeader); 676httpClient.DefaultRequestHeaders.Remove("X-Requested-With"); 678httpClient.DefaultRequestHeaders.Add("X-Requested-With", "XMLHttpRequest");
Microsoft.AspNetCore.Identity.FunctionalTests (26)
MapIdentityApiTests.cs (26)
124client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 156client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 188client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 223client.DefaultRequestHeaders.Add(HeaderNames.Cookie, cookie); 267client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 280client.DefaultRequestHeaders.Authorization = new("Bearer"); 283client.DefaultRequestHeaders.Authorization = new("Bearer", ""); 303client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 357client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 373client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 418client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 678client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 713client.DefaultRequestHeaders.Clear(); 732client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 750client.DefaultRequestHeaders.Clear(); 761client.DefaultRequestHeaders.Authorization = new("Bearer", recoveryAccessToken); 767client.DefaultRequestHeaders.Clear(); 784client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 831client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 848client.DefaultRequestHeaders.Clear(); 863client.DefaultRequestHeaders.Authorization = new("Bearer", recoveryAccessToken); 880client.DefaultRequestHeaders.Clear(); 1131client.DefaultRequestHeaders.Clear(); 1209client.DefaultRequestHeaders.Clear(); 1400client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken); 1481client.DefaultRequestHeaders.Add(HeaderNames.Cookie, cookie);
Microsoft.AspNetCore.Localization.Tests (13)
AcceptLanguageHeaderRequestCultureProviderTest.cs (8)
49client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("jp,ar-SA,en-US"); 50var count = client.DefaultRequestHeaders.AcceptLanguage.Count; 90client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("en-GB,ar-SA,en-US"); 91var count = client.DefaultRequestHeaders.AcceptLanguage.Count; 130client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("en-GB,ar-MA,en-US"); 131var count = client.DefaultRequestHeaders.AcceptLanguage.Count; 176client.DefaultRequestHeaders.AcceptLanguage.ParseAdd("en-GB,ar-YE,en-US"); 177var count = client.DefaultRequestHeaders.AcceptLanguage.Count;
CookieRequestCultureProviderTest.cs (4)
66client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue("Preferences", value).ToString()); 116client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue("Preferences", "uic=ar-SA").ToString()); 215client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue("Preferences", $"c={culture}|uic={uiCulture}").ToString()); 275client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue("Preferences", $"c={culture}|uic={uiCulture}").ToString());
RequestLocalizationMiddlewareTest.cs (1)
67client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue("Preferences", $"c={requestedCulture}|uic={requestedCulture}").ToString());
Microsoft.AspNetCore.Mvc.FunctionalTests (5)
ErrorPageTests.cs (2)
36Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html")); 56client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));
FiltersTest.cs (1)
20Client.DefaultRequestHeaders.Add("Authorization", "Bearer key");
SimpleWithWebApplicationBuilderTests.cs (2)
269Client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(antiforgeryOptions.Value.Cookie.Name, tokens.CookieToken).ToString()); 270Client.DefaultRequestHeaders.Add(tokens.HeaderName, tokens.RequestToken);
Microsoft.AspNetCore.OutputCaching.Tests (31)
OutputCacheTests.cs (31)
141client.DefaultRequestHeaders.CacheControl = 172client.DefaultRequestHeaders.Pragma.Clear(); 173client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("no-cache")); 268client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("abc"); 296client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("abc"); 317client.DefaultRequestHeaders.From = "user@example.com"; 341client.DefaultRequestHeaders.From = "user@example.com"; 343client.DefaultRequestHeaders.From = "user2@example.com"; 568client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 592client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 637client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 660client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 711client.DefaultRequestHeaders.IfModifiedSince = DateTimeOffset.MaxValue; 734client.DefaultRequestHeaders.IfModifiedSince = DateTimeOffset.MinValue; 760client.DefaultRequestHeaders.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"E1\"")); 783client.DefaultRequestHeaders.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"E2\"")); 875client.DefaultRequestHeaders.From = "user@example.com"; 877client.DefaultRequestHeaders.From = "user2@example.com"; 879client.DefaultRequestHeaders.From = "user@example.com"; 899client.DefaultRequestHeaders.From = "user@example.com"; 900client.DefaultRequestHeaders.Pragma.Clear(); 901client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 902client.DefaultRequestHeaders.MaxForwards = 1; 904client.DefaultRequestHeaders.From = "user2@example.com"; 905client.DefaultRequestHeaders.Pragma.Clear(); 906client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 907client.DefaultRequestHeaders.MaxForwards = 2; 909client.DefaultRequestHeaders.From = "user@example.com"; 910client.DefaultRequestHeaders.Pragma.Clear(); 911client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 912client.DefaultRequestHeaders.MaxForwards = 1;
Microsoft.AspNetCore.ResponseCaching.Tests (42)
ResponseCachingTests.cs (42)
151client.DefaultRequestHeaders.CacheControl = 184client.DefaultRequestHeaders.Pragma.Clear(); 185client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("no-cache")); 257client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("abc"); 280client.DefaultRequestHeaders.From = "user@example.com"; 303client.DefaultRequestHeaders.From = "user@example.com"; 305client.DefaultRequestHeaders.From = "user2@example.com"; 504client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 530client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 579client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 604client.DefaultRequestHeaders.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() 658client.DefaultRequestHeaders.IfModifiedSince = DateTimeOffset.MaxValue; 683client.DefaultRequestHeaders.IfModifiedSince = DateTimeOffset.MinValue; 711client.DefaultRequestHeaders.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"E1\"")); 736client.DefaultRequestHeaders.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"E2\"")); 833client.DefaultRequestHeaders.From = "user@example.com"; 835client.DefaultRequestHeaders.From = "user2@example.com"; 837client.DefaultRequestHeaders.From = "user@example.com"; 859client.DefaultRequestHeaders.From = "user@example.com"; 860client.DefaultRequestHeaders.Pragma.Clear(); 861client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 862client.DefaultRequestHeaders.MaxForwards = 1; 864client.DefaultRequestHeaders.From = "user2@example.com"; 865client.DefaultRequestHeaders.Pragma.Clear(); 866client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("Max-Forwards")); 867client.DefaultRequestHeaders.MaxForwards = 2; 869client.DefaultRequestHeaders.From = "user@example.com"; 870client.DefaultRequestHeaders.Pragma.Clear(); 871client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 872client.DefaultRequestHeaders.MaxForwards = 1; 894client.DefaultRequestHeaders.From = "user@example.com"; 895client.DefaultRequestHeaders.Pragma.Clear(); 896client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 897client.DefaultRequestHeaders.MaxForwards = 1; 899client.DefaultRequestHeaders.From = "user2@example.com"; 900client.DefaultRequestHeaders.Pragma.Clear(); 901client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 902client.DefaultRequestHeaders.MaxForwards = 2; 904client.DefaultRequestHeaders.From = "user@example.com"; 905client.DefaultRequestHeaders.Pragma.Clear(); 906client.DefaultRequestHeaders.Pragma.Add(new System.Net.Http.Headers.NameValueHeaderValue("From")); 907client.DefaultRequestHeaders.MaxForwards = 1;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
RequestBodyLimitTests.cs (1)
414client.DefaultRequestHeaders.TransferEncodingChunked = chunked;
RequestHeaderTests.cs (1)
238client.DefaultRequestHeaders.Add(header.Key, header.Value);
Microsoft.AspNetCore.Session.Tests (5)
SessionTests.cs (5)
204client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(cookie.Name, cookie.Value).ToString()); 264client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(cookie.Name, cookie.Value).ToString()); 322client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(cookie.Name, cookie.Value).ToString()); 426client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(cookie.Name, cookie.Value).ToString()); 495client.DefaultRequestHeaders.Add(
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
102httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*", 0.1));
Microsoft.AspNetCore.TestHost.Tests (2)
ClientHandlerTests.cs (2)
121httpClient.DefaultRequestHeaders.Add(HeaderNames.UserAgent, userAgent); 190httpClient.DefaultRequestHeaders.TransferEncodingChunked = true;
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (1)
1454client.DefaultRequestHeaders.Add("x-forwarded-proto", "https");
WebHostTests.cs (1)
81client.DefaultRequestHeaders.Add("x-forwarded-proto", "https");
Microsoft.DotNet.Build.Tasks.Feed (6)
src\CreateAzureDevOpsFeed.cs (2)
137client.DefaultRequestHeaders.Add( 140client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
src\PublishArtifactsInManifestBase.cs (4)
878client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( 882client.DefaultRequestHeaders.Add( 1238httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( 1307httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Git.IssueManager (2)
Clients\AzureDevOpsClient.cs (2)
57client.DefaultRequestHeaders.Add( 60client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
Microsoft.DotNet.VersionTools (5)
Automation\GitHubApi\GitHubClient.cs (3)
57_httpClient.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json"); 58_httpClient.DefaultRequestHeaders.Add("User-Agent", auth?.User ?? DefaultUserAgent); 61_httpClient.DefaultRequestHeaders.Add("Authorization", $"token {auth.AuthToken}");
Automation\VstsApi\VstsAdapterClient.cs (2)
55_httpClient.DefaultRequestHeaders.Add( 61_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
Sockets.FunctionalTests (2)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
184client.DefaultRequestHeaders.Connection.Clear(); 185client.DefaultRequestHeaders.Connection.Add("close");