Skip to content

Commit fd323c3

Browse files
committed
PR feedback
1 parent 718d107 commit fd323c3

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/Http/Routing/src/Builder/RoutingEndpointConventionBuilderExtensions.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@
66

77
namespace Microsoft.AspNetCore.Builder
88
{
9+
/// <summary>
10+
/// Extension methods for adding routing metadata to endpoint instances using <see cref="IEndpointConventionBuilder"/>.
11+
/// </summary>
912
public static class RoutingEndpointConventionBuilderExtensions
1013
{
14+
/// <summary>
15+
/// Requires that endpoints match one of the specified hosts during routing.
16+
/// </summary>
17+
/// <param name="builder">The <see cref="IEndpointConventionBuilder"/> to add the metadata to.</param>
18+
/// <param name="hosts">
19+
/// The hosts used during routing.
20+
/// Hosts should be Unicode rather than punycode, and may have a port.
21+
/// An empty collection means any host will be accepted.
22+
/// </param>
23+
/// <returns>A reference to this instance after the operation has completed.</returns>
1124
public static IEndpointConventionBuilder RequireHost(this IEndpointConventionBuilder builder, params string[] hosts)
1225
{
1326
if (builder == null)

src/Http/Routing/src/HostAttribute.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace Microsoft.AspNetCore.Routing
1212
/// Attribute for providing host metdata that is used during routing.
1313
/// </summary>
1414
[DebuggerDisplay("{DebuggerToString(),nq}")]
15-
public class HostAttribute : IHostMetadata
15+
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
16+
public sealed class HostAttribute : Attribute, IHostMetadata
1617
{
1718
/// <summary>
1819
/// Initializes a new instance of the <see cref="HostAttribute" /> class.

src/Http/Routing/src/Matching/HostMatcherPolicy.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
namespace Microsoft.AspNetCore.Routing.Matching
1010
{
11-
public class HostMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy
11+
/// <summary>
12+
/// An <see cref="MatcherPolicy"/> that implements filtering and selection by
13+
/// the host header of a request.
14+
/// </summary>
15+
public sealed class HostMatcherPolicy : MatcherPolicy, IEndpointComparerPolicy, INodeBuilderPolicy
1216
{
1317
// Run after HTTP methods, but before 'default'.
1418
public override int Order { get; } = -100;

0 commit comments

Comments
 (0)