Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public static class RoutingEndpointConventionBuilderExtensions
/// An empty collection means any host will be accepted.
/// </param>
/// <returns>A reference to this instance after the operation has completed.</returns>
/// <remarks>
/// API that relies on the <see href="https://developer.mozilla.org/docs/Web/HTTP/Headers/Host">Host header</see>, such as
Comment thread
bseptember marked this conversation as resolved.
Outdated
/// <see cref="HttpRequest.Host"/> and <see cref="RequireHost"/>, are subject to potential spoofing by clients.
Comment thread
bseptember marked this conversation as resolved.
Outdated
Comment thread
bseptember marked this conversation as resolved.
Outdated
///
/// To prevent host and port spoofing, use one of the following approaches:
///
/// - Use <see cref="HttpContext.Connection"/> (<see cref="ConnectionInfo.LocalPort"/>) where the ports are checked.
Comment thread
bseptember marked this conversation as resolved.
Outdated
/// - Employ <see href="https://learn.microsoft.com/aspnet/core/fundamentals/servers/kestrel/host-filtering">Host filtering</see>.
/// </remarks>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// </remarks>

public static TBuilder RequireHost<TBuilder>(this TBuilder builder, params string[] hosts) where TBuilder : IEndpointConventionBuilder
{
ArgumentNullException.ThrowIfNull(builder);
Expand Down