14 instantiations of HostString
Microsoft.AspNetCore.HostFiltering (1)
MiddlewareConfigurationManager.cs (1)
67var host = new HostString(entry).ToUriComponent();
Microsoft.AspNetCore.Http.Abstractions (2)
HostString.cs (2)
192return new HostString(uriComponent); 205return new HostString(uri.GetComponents(
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
81var host = new HostString(entry).ToUriComponent();
Microsoft.AspNetCore.HttpsPolicy (2)
HttpsRedirectionMiddleware.cs (2)
94host = new HostString(host.Host, port); 98host = new HostString(host.Host);
Microsoft.AspNetCore.Mvc.Core (2)
RequireHttpsAttribute.cs (2)
80host = new HostString(host.Host, optionsAccessor.Value.SslPort.Value); 85host = new HostString(host.Host);
Microsoft.AspNetCore.Rewrite (6)
RedirectRule.cs (2)
70host = new HostString(newPath.Substring(schemeSplit)); 75host = new HostString(newPath.Substring(schemeSplit, pathSplit - schemeSplit));
RedirectToHttpsRule.cs (2)
24host = new HostString(host.Host, port); 29host = new HostString(host.Host);
RedirectToNonWwwRule.cs (1)
54new HostString(request.Host.Value.Substring(4)), // We verified the hostname begins with "www." already.
RedirectToWwwRule.cs (1)
54new HostString($"www.{context.HttpContext.Request.Host.Value}"),
61 references to HostString
Microsoft.AspNetCore.HeaderParsing (2)
HostHeaderValue.cs (2)
74var hs = HostString.FromUriComponent(value);
Microsoft.AspNetCore.HostFiltering (1)
HostFilteringMiddleware.cs (1)
103if (allowedHosts is not null && HostString.MatchesAny(new StringSegment(host), allowedHosts))
Microsoft.AspNetCore.Hosting (2)
Internal\HostingApplicationDiagnostics.cs (1)
565[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(HostString))]
Internal\HostingTelemetryHelpers.cs (1)
48public static bool TryGetServerPort(HostString host, string scheme, [NotNullWhen(true)] out object? port)
Microsoft.AspNetCore.Http (2)
Internal\DefaultHttpRequest.cs (2)
115public override HostString Host 117get { return HostString.FromUriComponent(Headers.Host.ToString()); }
Microsoft.AspNetCore.Http.Abstractions (19)
HostString.cs (17)
18public readonly struct HostString : IEquatable<HostString> 134/// <returns>The <see cref="HostString"/> value formated for use in a URI or HTTP header.</returns> 160/// <param name="uriComponent">The URI component string to create a <see cref="HostString"/> from.</param> 161/// <returns>The <see cref="HostString"/> that was created.</returns> 162public static HostString FromUriComponent(string uriComponent) 199/// <param name="uri">The <see cref="Uri"/> to create a <see cref="HostString"/> from.</param> 200/// <returns>The <see cref="HostString"/> that was created.</returns> 201public static HostString FromUriComponent(Uri uri) 279/// <param name="other">The <see cref="HostString"/> to compare against.</param> 281public bool Equals(HostString other) 301return obj is HostString value && Equals(value); 318/// <returns><see langword="true" /> if both <see cref="HostString"/>'s have the same value.</returns> 319public static bool operator ==(HostString left, HostString right) 329/// <returns><see langword="true" /> if both <see cref="HostString"/>'s values are not equal.</returns> 330public static bool operator !=(HostString left, HostString right)
HttpRequest.cs (2)
46public abstract HostString Host { get; set; } 167public HostString Host => _request.Host;
Microsoft.AspNetCore.Http.Extensions (7)
RequestHeaders.cs (2)
214public HostString Host 218return HostString.FromUriComponent(Headers.Host.ToString());
UriHelper.cs (5)
52HostString host, 107out HostString host, 149host = HostString.FromUriComponent(uri.Substring(startIndex, limit - startIndex)); 166host: HostString.FromUriComponent(uri), 224/// Initializes the URI <see cref="string"/> for <see cref="BuildAbsolute(string, HostString, PathString, PathString, QueryString, FragmentString)"/>.
Microsoft.AspNetCore.HttpOverrides (2)
ForwardedHeadersMiddleware.cs (2)
276&& (_allowAllHosts || HostString.MatchesAny(set.Host, _allowedHosts!))) 360request.Host = HostString.FromUriComponent(currentValues.Host);
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionMiddleware.cs (1)
91var host = context.Request.Host;
Microsoft.AspNetCore.Mvc.Core (5)
RequireHttpsAttribute.cs (1)
76var host = request.Host;
Routing\ControllerLinkGeneratorExtensions.cs (2)
141HostString? host = default, 193HostString host,
Routing\PageLinkGeneratorExtensions.cs (2)
142HostString? host = default, 194HostString host,
Microsoft.AspNetCore.Rewrite (6)
RedirectRule.cs (2)
59var host = default(HostString);
RedirectToHttpsRule.cs (1)
19var host = context.HttpContext.Request.Host;
RedirectToWwwHelper.cs (1)
42public static void SetRedirect(RewriteContext context, HostString newHost, int statusCode)
RewriteRule.cs (1)
58HostString host;
UrlActions\RewriteAction.cs (1)
65HostString host;
Microsoft.AspNetCore.Routing (12)
DefaultLinkGenerator.cs (3)
125HostString? host = default, 153HostString host, 239HostString host,
LinkGeneratorEndpointNameAddressExtensions.cs (4)
189HostString? host = default, 248HostString? host = default, 301HostString host, 350HostString host,
LinkGeneratorRouteValuesAddressExtensions.cs (4)
189HostString? host = default, 248HostString? host = default, 301HostString host, 344HostString host,
Matching\HostMatcherPolicy.cs (1)
340var hostString = httpContext.Request.Host;
Microsoft.AspNetCore.Routing.Abstractions (2)
LinkGenerator.cs (2)
115HostString? host = default, 151HostString host,