199 references to Host
Aspire.Azure.AI.OpenAI (1)
AspireConfigurableOpenAIExtensions.cs (1)
111if (serviceUri != null && serviceUri.Host.Contains(".azure.", StringComparison.OrdinalIgnoreCase))
Aspire.Azure.Messaging.EventHubs (2)
EventHubsComponent.cs (2)
55? EventHubsConnectionStringProperties.Parse(settings.ConnectionString).Endpoint.Host 56: new Uri(settings.FullyQualifiedNamespace).Host;
Aspire.Dashboard (1)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
43if (Uri.TryCreate(url, UriKind.Absolute, out var uri) && string.Equals(uri.Host, "localhost", StringComparisons.UrlHost))
Aspire.Dashboard.Tests (3)
Integration\FrontendBrowserTokenAuthTests.cs (1)
241Assert.Equal(linkHost, uri.Host);
Integration\FrontendOpenIdConnectAuthTests.cs (1)
49Assert.Equal("localhost", redirectedTo.Host);
Integration\StartupTests.cs (1)
651Assert.Equal("localhost", uri.Host);
Aspire.Hosting (1)
Devcontainers\Codespaces\CodespacesResourceUrlRewriterService.cs (1)
36if (!originalUrlSnapshot.IsInternal && (uri.Scheme == "http" || uri.Scheme == "https") && uri.Host == "localhost")
Aspire.Hosting.Testing.Tests (3)
TestingBuilderTests.cs (2)
62Assert.True(serviceAHttpEndpoint.Host.Length > 0); 119Assert.True(workerEndpoint.Host.Length > 0);
TestingFactoryTests.cs (1)
25Assert.True(workerEndpoint.Host.Length > 0);
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
217activity.AddTag("server.address", address.Host);
Aspire.RabbitMQ.Client.Tests (1)
AspireRabbitMQExtensionsTests.cs (1)
198Assert.Equal(uri.Host, endpoint.HostName);
Client.ExpectedExceptions.IntegrationTests (1)
ExpectedExceptionTests.4.1.0.cs (1)
92string hostName = new Uri(Endpoints.HttpBaseAddress_Basic_Text).Host;
ClientSample (2)
Tcp\TcpHubConnectionBuilderExtensions.cs (2)
26if (string.Equals(uri.Host, "localhost")) 32endPoint = new IPEndPoint(IPAddress.Parse(uri.Host), uri.Port);
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
395var parts = uri.Host.Split('.');
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
189FilenameFromUri_Add(fileNameBuilder, nsUri.Host);
dotnet-svcutil-lib (11)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
1437string host = uri.Host;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (4)
500new EndpointNotFoundException(string.Format(SRServiceModel.UnableToResolveHost, uri.Host), socketException)); 506new EndpointNotFoundException(string.Format(SRServiceModel.UnableToResolveHost, uri.Host))); 574new EndpointNotFoundException(string.Format(SRServiceModel.NoIPEndpointsFoundForHost, uri.Host))); 626new EndpointNotFoundException(string.Format(SRServiceModel.NoIPEndpointsFoundForHost, uri.Host)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceMetadataExtension.cs (2)
196: this(listenUri.Host, requestHost, removeBaseAddress, listenUri.Scheme, requestPort, updatePortsByScheme) 262if (uri.Host != _oldHostName)
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (2)
371if (string.Compare(u1.Host, u2.Host, StringComparison.OrdinalIgnoreCase) != 0)
Metadata\MetadataFileNameManager.cs (1)
127FileNameFromNS_Add(fileNameBuilder, nsUri.Host);
OutputPathHelper.cs (1)
138FilenameFromUri_Add(fileNameBuilder, nsUri.Host);
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (3)
133await client.ConnectAsync(uri.Host, uri.Port); 153await client.ConnectAsync(uri.Host, uri.Port); 178builder.Append(uri.Host);
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (3)
133await client.ConnectAsync(uri.Host, uri.Port); 153await client.ConnectAsync(uri.Host, uri.Port); 178builder.Append(uri.Host);
InMemory.FunctionalTests (2)
TestTransport\InMemoryHttpClientSlim.cs (2)
54var address = IPAddress.Parse(requestUri.Host); 127await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null,
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
WebAssemblyNetDebugProxyAppBuilderExtensions.cs (1)
32devToolsHost = $"http://{browserUrl.Host}:{browserUrl.Port}";
Microsoft.AspNetCore.Components.WebView.Maui (1)
iOS\IOSWebViewManager.cs (1)
274 if (_currentUri?.Host == BlazorWebView.AppHostAddress)
Microsoft.AspNetCore.Cors (3)
Infrastructure\CorsPolicyBuilder.cs (1)
73!string.Equals(uri.IdnHost, uri.Host, StringComparison.Ordinal))
Infrastructure\UriHelpers.cs (2)
14&& subdomain.Host.EndsWith($".{domain.Host}", StringComparison.Ordinal);
Microsoft.AspNetCore.HeaderParsing.Tests (1)
ParserTests.cs (1)
275Assert.Equal("foo.com", result!.Host);
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\Utils.cs (1)
16Host = url.Host,
Microsoft.AspNetCore.InternalTesting (3)
HttpClientSlim.cs (3)
53var address = IPAddress.Parse(requestUri.Host); 160await sslStream.AuthenticateAsClientAsync(requestUri.Host, clientCertificates: null, 191throw new SocketException((int)socketArgs.SocketError, $"Failed to connect to server {requestUri.Host} on port {requestUri.Port}");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (18)
Listener\RequestHeaderTests.cs (1)
225socket.Connect(uri.Host, uri.Port);
Listener\RequestTests.cs (1)
186socket.Connect(uri.Host, uri.Port);
OpaqueUpgradeTests.cs (4)
333await client.ConnectAsync(uri.Host, uri.Port); 345builder.Append(uri.Host); 386await client.ConnectAsync(uri.Host, uri.Port); 416builder.Append(uri.Host);
RequestBodyTests.cs (2)
317await client.ConnectAsync(uri.Host, uri.Port); 343builder.Append(uri.Host);
RequestHeaderTests.cs (2)
74socket.Connect(uri.Host, uri.Port); 275socket.Connect(uri.Host, uri.Port);
RequestTests.cs (5)
387socket.Connect(uri.Host, uri.Port); 543await socket.ConnectAsync(uri.Host, uri.Port); 590await socket.ConnectAsync(uri.Host, uri.Port); 610server.Listener.Options.UrlPrefixes.Add(UrlPrefix.Create(rootUri.Scheme, rootUri.Host, rootUri.Port, path)); 639socket.Connect(uri.Host, uri.Port);
ResponseTests.cs (1)
267socket.Connect(uri.Host, uri.Port);
ServerTests.cs (2)
663await client.ConnectAsync(uri.Host, uri.Port); 689builder.Append(uri.Host);
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
1067activity.SetTag("server.address", uri.Host);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
HubConnectionTests.cs (1)
1715cookieJar.Add(new System.Net.Cookie("Foo", "Bar", "/", new Uri(server.Url).Host));
Microsoft.Build.Tasks.Core (3)
ManifestUtil\PathUtil.cs (3)
129return String.IsNullOrEmpty(u.Host); 199return !u.IsUnc && !String.IsNullOrEmpty(u.Host); 221if (String.Equals(u.Host, localHost, StringComparison.OrdinalIgnoreCase))
Microsoft.CodeAnalysis.Features (2)
AddImport\PackageSourceHelper.cs (2)
47return uri.Host.EndsWith($".{NugetOrg}", StringComparison.OrdinalIgnoreCase) 48|| uri.Host.Equals(NugetOrg, StringComparison.OrdinalIgnoreCase);
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\SourceGeneratedDocumentUri.cs (1)
58var projectIdGuidOnly = ProjectId.CreateFromSerialized(Guid.ParseExact(documentUri.Host, GuidFormat));
Microsoft.DotNet.Build.Tasks.Feed (2)
src\BlobUrlInfo.cs (1)
39string hostName = uri.Host;
src\BuildModelFactory.cs (1)
288repoUri = repoUri.Replace(parsedUri.Host, replacementUri);
Microsoft.DotNet.Git.IssueManager (3)
Helpers\RepositoryHelper.cs (3)
21if (parsedUri.Host == "github.com") 53if (parsedUri.Host == "github.com") 84if (parsedUri.Host == "github.com")
Microsoft.Extensions.Http (4)
Logging\LogHelper.cs (4)
200(true, true) => $"{uri.Scheme}://{uri.Host}{GetPath(pathAndQuery, queryIndex)}*", 201(true, false) => $"{uri.Scheme}://{uri.Host}:{uri.Port}{GetPath(pathAndQuery, queryIndex)}*", 202(false, true) => $"{uri.Scheme}://{uri.Host}{pathAndQuery}", 203(false, false) => $"{uri.Scheme}://{uri.Host}:{uri.Port}{pathAndQuery}"
Microsoft.Extensions.Http.Diagnostics (5)
Http\DownstreamDependencyMetadataManager.cs (2)
51var hostMetadata = GetHostMetadata(requestMessage.RequestUri.Host); 67var hostMetadata = GetHostMetadata(requestMessage.RequestUri.Host);
Logging\Internal\HttpClientLogger.cs (2)
97Log.RequestReadError(_logger, ex, request.Method, request.RequestUri?.Host, pathToLog); 167Log.LoggerContextMissing(_logger, exception, requestState, request.Method, request.RequestUri?.Host);
Logging\Internal\HttpRequestReader.cs (1)
99logRecord.Host = request.RequestUri?.Host ?? TelemetryConstants.Unknown;
Microsoft.Extensions.Http.Diagnostics.Tests (6)
Logging\AcceptanceTests.cs (5)
47Assert.Equal($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", logRecord.Message); 80Assert.EndsWith($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", firstLogRecord.Message); 88Assert.Equal($"{HttpMethod.Get} {_unreachableRequestUri.Host}/{TelemetryConstants.Redacted}", secondLogRecord.Message); 117Assert.Equal($"{httpRequestMessage.Method} {httpRequestMessage.RequestUri.Host}/{TelemetryConstants.Redacted}", logRecord.Message); 373.Which.Value.Should().Be(httpRequestMessage.RequestUri.Host);
Logging\HttpClientLoggerTest.cs (1)
441Assert.Equal($"{httpRequestMessage.Method} {httpRequestMessage.RequestUri.Host}/{TelemetryConstants.Redacted}", logRecord.Message);
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
345return r.RequestUri.Host;
Microsoft.Extensions.Http.Resilience (3)
Internal\UriExtensions.cs (2)
25if (currentUri.Scheme == hostUri.Scheme && currentUri.Host == hostUri.Host && currentUri.Port == hostUri.Port && hostUri.LocalPath == "/")
Resilience\Internal\ByAuthorityPipelineKeyProvider.cs (1)
18var key = (url.Scheme, url.Host, url.Port);
Microsoft.Extensions.Http.Resilience.Tests (2)
Hedging\StandardHedgingTests.cs (2)
354if (request.RequestUri?.Host == failingEndpoint) 368if (request.RequestUri?.Host == failingEndpoint)
Microsoft.Extensions.ServiceDiscovery (5)
Configuration\ConfigurationServiceEndpointProvider.cs (2)
207if (IPAddress.TryParse(uri.Host, out var ip)) 213endPoint = new DnsEndPoint(uri.Host, port);
Http\ResolvingHttpClientHandler.cs (1)
23if (originalUri?.Host is not null)
Http\ResolvingHttpDelegatingHandler.cs (1)
44if (originalUri?.Host is not null)
PassThrough\PassThroughServiceEndpointProviderFactory.cs (1)
37var uriHost = uri.Host;
Microsoft.Extensions.ServiceDiscovery.Abstractions (1)
ServiceEndpointQuery.cs (1)
54var uriHost = uri.Host;
Microsoft.Extensions.ServiceDiscovery.Yarp (2)
ServiceDiscoveryDestinationResolver.cs (2)
80uriBuilder.Host = uri.Host; 86healthUriBuilder.Host = uri.Host;
Microsoft.Maui (3)
Handlers\WebView\WebViewHandler.iOS.cs (3)
322 if (!_loadedCookies.Add(uri.Host)) 362 string domain = uriForCookies.Host; 490 if (string.IsNullOrWhiteSpace(uri.Host))
Microsoft.Maui.Controls (1)
Shell\ShellUriHandler.cs (1)
141 pathAndQuery = $"{request.Host}/{request.PathAndQuery}".Split('?');
Microsoft.Maui.Controls.Compatibility (3)
iOS\Renderers\WkWebViewRenderer.cs (3)
322 if (String.IsNullOrWhiteSpace(uri.Host)) 364 string domain = CreateUriForCookies(url).Host; 390 if (!_loadedCookies.Add(uri.Host))
Microsoft.Maui.Essentials (3)
Types\Shared\WebUtils.shared.cs (3)
95 if (!string.IsNullOrEmpty(expectedUrl.Host)) 97 if (!callbackUrl.Host.Equals(expectedUrl.Host, StringComparison.OrdinalIgnoreCase))
Microsoft.ML.Core (2)
Utilities\ResourceManagerUtils.cs (2)
119if (absoluteUrl.Host != "aka.ms") 275if (uri.Host == "aka.ms" && IsRedirectToDefaultPage(uri.AbsoluteUri))
PresentationBuildTasks (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\ResourceIDHelper.cs (2)
57if (baseUri.Scheme == sourceUri.Scheme && baseUri.Host == sourceUri.Host)
PresentationCore (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\BindUriHelper.cs (2)
82return string.Equals(first.Scheme, second.Scheme, StringComparison.OrdinalIgnoreCase) && string.Equals(first.Host, second.Host);
PresentationFramework (10)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\BindUriHelper.cs (2)
82return string.Equals(first.Scheme, second.Scheme, StringComparison.OrdinalIgnoreCase) && string.Equals(first.Host, second.Host);
System\Windows\Documents\FixedDocument.cs (8)
871if (baseUri.Host.Equals(BaseUriHelper.PackAppBaseUri.Host) != true && 872baseUri.Host.Equals(BaseUriHelper.SiteOfOriginBaseUri.Host) != true) 899if (baseUri.Host.Equals(BaseUriHelper.PackAppBaseUri.Host) != true && 900baseUri.Host.Equals(BaseUriHelper.SiteOfOriginBaseUri.Host) != true)
Security.TransportSecurity.IntegrationTests (15)
Tcp\ClientCredentialTypeCertificateCanonicalNameTests.4.1.0.cs (15)
34bool shouldCallSucceed = string.Compare(localhostEndpointUri.Host, "localhost", StringComparison.OrdinalIgnoreCase) == 0; 62errorBuilder.AppendFormat("The call to '{0}' should have failed but succeeded. ", localhostEndpointUri.Host); 83errorBuilder.AppendFormat("The call to '{0}' should have been successful but failed with a MessageSecurityException. ", localhostEndpointUri.Host); 85errorBuilder.AppendFormat("When connecting to host '{0}', the expectation is that the DNSClaim will be for the same hostname. ", localhostEndpointUri.Host); 110bool shouldCallSucceed = domainNameEndpointUri.Host.IndexOf('.') == -1 && string.Compare(domainNameEndpointUri.Host, "localhost", StringComparison.OrdinalIgnoreCase) != 0; 138errorBuilder.AppendFormat("The call to '{0}' should have failed but succeeded. ", domainNameEndpointUri.Host); 159errorBuilder.AppendFormat("The call to '{0}' should have been successful but failed with a MessageSecurityException. ", domainNameEndpointUri.Host); 161errorBuilder.AppendFormat("When connecting to host '{0}', the expectation is that the DNSClaim will be for the same hostname. ", domainNameEndpointUri.Host); 183var domainNameHost = domainNameEndpointUri.Host.Split('.')[0]; 191if (string.Compare(domainNameHost, fqdnEndpointUri.Host, StringComparison.OrdinalIgnoreCase) != 0) 193shouldCallSucceed = fqdnEndpointUri.Host.IndexOf('.') > -1; 224errorBuilder.AppendFormat("The call to '{0}' should have failed but succeeded. ", fqdnEndpointUri.Host); 243errorBuilder.AppendFormat("The call to '{0}' should have been successful but failed with a MessageSecurityException. ", fqdnEndpointUri.Host); 245errorBuilder.AppendFormat("When connecting to host '{0}', the expectation is that the DNSClaim will be for the same hostname. ", fqdnEndpointUri.Host);
System.Diagnostics.Process (1)
System\Diagnostics\Process.Unix.cs (1)
645if (uri.IsFile && uri.Host == "" && File.Exists(uri.LocalPath))
System.Net.Http (18)
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (2)
63if (uriPrefix.Scheme != uri.Scheme || uriPrefix.Host != uri.Host || uriPrefix.Port != uri.Port)
System\Net\Http\DiagnosticsHandler.cs (4)
130activity.SetTag("server.address", requestUri.Host); 257[DynamicDependency(nameof(Uri.Host), typeof(Uri))] 290[DynamicDependency(nameof(Uri.Host), typeof(Uri))] 311[DynamicDependency(nameof(Uri.Host), typeof(Uri))]
System\Net\Http\DiagnosticsHelper.cs (4)
38(true, true) => $"{uri.Scheme}://{uri.Host}{pathAndQuery.AsSpan(0, queryIndex + 1)}*", 39(true, false) => $"{uri.Scheme}://{uri.Host}:{uri.Port}{pathAndQuery.AsSpan(0, queryIndex + 1)}*", 40(false, true) => $"{uri.Scheme}://{uri.Host}{pathAndQuery}", 41(false, false) => $"{uri.Scheme}://{uri.Host}:{uri.Port}{pathAndQuery}"
System\Net\Http\Metrics\MetricsHandler.cs (1)
142tags.Add("server.address", requestUri.Host);
System\Net\Http\SocketsHttpHandler\HttpAuthority.cs (1)
32HostValue = uri.Host;
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
402string host = requestUri.HostNameType == UriHostNameType.IPv6 ? requestUri.Host : requestUri.IdnHost;
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (5)
264if ((s.Length - 1) == input.Host.Length && 265string.Compare(s, 1, input.Host, 0, input.Host.Length, StringComparison.OrdinalIgnoreCase) == 0) 269else if (input.Host.EndsWith(s, StringComparison.OrdinalIgnoreCase)) 277if (string.Equals(s, input.Host, StringComparison.OrdinalIgnoreCase))
System.Net.HttpListener (3)
System\Net\Managed\HttpEndPointListener.cs (1)
181string host = uri.Host;
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
162host = raw_uri.Host;
System\Net\ServiceNameStore.cs (1)
223return hostUri.Host;
System.Net.Primitives (8)
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (2)
63if (uriPrefix.Scheme != uri.Scheme || uriPrefix.Host != uri.Host || uriPrefix.Port != uri.Port)
System\Net\Cookie.cs (1)
328string host = uri.Host;
System\Net\CookieContainer.cs (5)
255new_cookie.VerifySetDefaults(new_cookie.Variant, uri, IsLocalDomain(uri.Host), m_fqdnMyDomain, true, true); 659new_cookie.VerifySetDefaults(new_cookie.Variant, uri, IsLocalDomain(uri.Host), m_fqdnMyDomain, true, true); 669bool isLocalDomain = IsLocalDomain(uri.Host); 699bool isLocalDomain = IsLocalDomain(uri.Host); 807string fqdnRemote = uri.Host;
System.Net.Requests (8)
System\Net\FtpControlStream.cs (4)
196request.RequestUri.Host, 207request.RequestUri.Host, 402request.RequestUri.Host, 427request.RequestUri.Host,
System\Net\FtpWebRequest.cs (2)
959await client.ConnectAsync(_uri.Host, _uri.Port).ConfigureAwait(false); 972string hostname = _uri.Host;
System\Net\HttpWebRequest.cs (2)
369hostUri.Host : 370$"{hostUri.Host}:{hostUri.Port}";
System.Net.WebProxy (4)
System\Net\WebProxy.cs (3)
171int lengthRequired = input.Scheme.Length + 3 + input.Host.Length; 180url.TryWrite($"{input.Scheme}://{input.Host}", out charsWritten) : 181url.TryWrite($"{input.Scheme}://{input.Host}:{(uint)input.Port}", out charsWritten);
System\Net\WebProxy.NonWasm.cs (1)
23string hostString = host.Host;
System.Private.Uri (5)
System\Uri.cs (4)
1849if ((Scheme == uri.Scheme) && (Host == uri.Host) && (Port == uri.Port)) 4978if ((Scheme == toUri.Scheme) && (Host == toUri.Host) && (Port == toUri.Port))
System\UriBuilder.cs (1)
282_host = _uri.Host;
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
1529string host = uri.Host;
System.ServiceModel.NetNamedPipe (1)
System\ServiceModel\Channels\PipeConnectionInitiator.cs (1)
74string[] hostChoices = new string[] { "+", uri.Host, "*" };
System.ServiceModel.UnixDomainSocket (2)
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (2)
43var hostIdentity = new DnsEndpointIdentity(string.IsNullOrEmpty(address.Uri.Host) ? "localhost" : address.Uri.Host);