102 references to TryAddWithoutValidation
Aspire.Dashboard.Tests (29)
Integration\OtlpCorsHttpServiceTests.cs (15)
31preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Method", "POST"); 32preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Headers", "x-requested-with,x-custom,Content-Type"); 33preflightRequest.Headers.TryAddWithoutValidation("Origin", "http://localhost:8000"); 56preflightRequest1.Headers.TryAddWithoutValidation("Access-Control-Request-Method", "POST"); 57preflightRequest1.Headers.TryAddWithoutValidation("Access-Control-Request-Headers", "x-requested-with,x-custom,Content-Type"); 58preflightRequest1.Headers.TryAddWithoutValidation("Origin", "http://localhost:8000"); 70preflightRequest2.Headers.TryAddWithoutValidation("Access-Control-Request-Method", "POST"); 71preflightRequest2.Headers.TryAddWithoutValidation("Access-Control-Request-Headers", "x-requested-with,x-custom,Content-Type"); 72preflightRequest2.Headers.TryAddWithoutValidation("Origin", "http://localhost:8001"); 96preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Method", "POST"); 97preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Headers", "x-requested-with,x-custom,Content-Type"); 98preflightRequest.Headers.TryAddWithoutValidation("Origin", "http://localhost:8001"); 124preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Method", "POST"); 125preflightRequest.Headers.TryAddWithoutValidation("Access-Control-Request-Headers", "x-requested-with,x-custom,Content-Type"); 126preflightRequest.Headers.TryAddWithoutValidation("Origin", "http://localhost:8000");
Integration\OtlpHttpServiceTests.cs (13)
44content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 70content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 114content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 138content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 142requestMessage.Headers.TryAddWithoutValidation(OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, "WRONG"); 166content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 170requestMessage.Headers.TryAddWithoutValidation(OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, apiKey); 204content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 233content.Headers.TryAddWithoutValidation("content-type", contentType); 259content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 285content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 314content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType); 343content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType);
Integration\StartupTests.cs (1)
405content.Headers.TryAddWithoutValidation("content-type", OtlpHttpEndpointsBuilder.ProtobufContentType);
AuthSamples.FunctionalTests (2)
HttpClientExtensions.cs (2)
54if (!submision.Headers.TryAddWithoutValidation(header.Key, header.Value)) 56submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1182_httpRequestMessage.Headers.TryAddWithoutValidation("SOAPAction", action);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (2)
93contentHeaders.TryAddWithoutValidation(headerKey, headersToMerge[headerKey]); 97mainHeaders.TryAddWithoutValidation(headerKey, headersToMerge[headerKey]);
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (2)
1489request1.Headers.TryAddWithoutValidation("User-Agent", "TestUserAgent"); 1500request2.Headers.TryAddWithoutValidation("User-Agent", "TestUserAgent");
Microsoft.AspNetCore.HeaderPropagation (2)
HeaderPropagationMessageHandler.cs (2)
70if (!request.Headers.TryAddWithoutValidation(entry.OutboundHeaderName, value) && hasContent) 72request.Content!.Headers.TryAddWithoutValidation(entry.OutboundHeaderName, value);
Microsoft.AspNetCore.HttpLogging.Tests (3)
HttpLoggingMiddlewareTests.cs (3)
1803request.Headers.TryAddWithoutValidation("Accept", "application/json"); 1893request.Headers.TryAddWithoutValidation("Accept", "application/json"); 1939request.Headers.TryAddWithoutValidation("Accept", "application/json");
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Extensions\HttpClientExtensions.cs (2)
56submision.Headers.TryAddWithoutValidation(header.Key, header.Value); 57submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
Microsoft.AspNetCore.Mvc.FunctionalTests (27)
ContentNegotiationTest.cs (1)
110request.Headers.TryAddWithoutValidation("Accept", acceptHeader);
ControllerFromServicesTests.cs (1)
36request.Headers.TryAddWithoutValidation("Test-Header", "test-header-value");
FileResultTests.cs (14)
82httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 102httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 146httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 166httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 280httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 369httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 389httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 499httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 570httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 590httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 705httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 851httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 874httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString); 909httpRequestMessage.Headers.TryAddWithoutValidation("Range", rangeString);
JsonResultWithNewtonsoftJsonTest.cs (1)
65request.Headers.TryAddWithoutValidation("Accept", mediaType);
JsonResultWithSystemTextJsonTest.cs (1)
65request.Headers.TryAddWithoutValidation("Accept", mediaType);
RazorPagesWithBasePathTest.cs (3)
442message.Headers.TryAddWithoutValidation("Cookie", $"{cookie.Key}={cookie.Value}"); 471message.Headers.TryAddWithoutValidation("Cookie", $"{cookie.Key}={cookie.Value}"); 499message.Headers.TryAddWithoutValidation("Cookie", $"{cookie.Key}={cookie.Value}");
RequestServicesTestBase.cs (4)
54request.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId); 77request.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId); 97request1.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId1); 106request2.Headers.TryAddWithoutValidation(HeaderNames.RequestId, requestId2);
TestingInfrastructureTests.cs (2)
82Assert.True(request.Headers.TryAddWithoutValidation("X-Invalid-Request-Header", "Bearer 1234,5678")); 83Assert.True(request.Content.Headers.TryAddWithoutValidation("X-Invalid-Content-Header", "Bearer 1234,5678"));
Microsoft.AspNetCore.Server.IISIntegration.Tests (13)
IISMiddlewareTests.cs (13)
55req.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 135request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 136request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-EVENT", shutdownEvent); 194request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 195request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-EVENT", "shutdown"); 239request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 240request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-EVENT", "shutdown"); 284request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 285request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-EVENT", shutdownEvent); 384request.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 425req.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 482req.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken"); 527req.Headers.TryAddWithoutValidation("MS-ASPNETCORE-TOKEN", "TestToken");
Microsoft.AspNetCore.StaticAssets.Tests (3)
StaticAssetsIntegrationTests.cs (3)
868req.Headers.TryAddWithoutValidation("If-Modified-Since", "bad-date"); 928req2.Headers.TryAddWithoutValidation("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture)); 958req.Headers.TryAddWithoutValidation("If-Unmodified-Since", "bad-date");
Microsoft.AspNetCore.StaticFiles.Tests (4)
RangeHeaderTests.cs (4)
345req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); 360req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); 380req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); 402req.Headers.TryAddWithoutValidation("Range", "bytes=" + range);
Microsoft.AspNetCore.TestHost (2)
RequestBuilder.cs (2)
52if (!_req.Headers.TryAddWithoutValidation(name, value)) 58if (!_req.Content.Headers.TryAddWithoutValidation(name, value))
System.Net.Http.Json (1)
System\Net\Http\Json\JsonContent.cs (1)
39Headers.TryAddWithoutValidation("Content-Type", JsonHelpers.DefaultMediaType);
System.Net.Requests (2)
System\Net\HttpWebRequest.cs (2)
1201_sendRequestMessage.Content.Headers.TryAddWithoutValidation(headerName, _webHeaderCollection[headerName!]); 1205_sendRequestMessage.Headers.TryAddWithoutValidation(headerName, _webHeaderCollection[headerName!]);
System.Net.WebSockets.Client (7)
System\Net\WebSockets\WebSocketHandle.Managed.cs (7)
104request.Headers.TryAddWithoutValidation(key, options.RequestHeaders[key]); 391request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.Connection, HttpKnownHeaderNames.Upgrade); 392request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.Upgrade, "websocket"); 393request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.SecWebSocketKey, secKeyAndSecWebSocketAccept.Key); 400request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.SecWebSocketVersion, "13"); 404request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.SecWebSocketProtocol, string.Join(", ", options.RequestedSubProtocols)); 408request.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.SecWebSocketExtensions, GetDeflateOptions(options.DangerousDeflateOptions));