Add host caution to MVC GetUri extension methods (#12629)
This commit is contained in:
parent
98abd9e256
commit
2d4fd05adf
|
|
@ -138,6 +138,14 @@ namespace Microsoft.AspNetCore.Routing
|
|||
/// names from <c>RouteOptions</c>.
|
||||
/// </param>
|
||||
/// <returns>A absolute URI, or <c>null</c> if a URI cannot be created.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
|
||||
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
|
||||
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
|
||||
/// your deployment environment.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static string GetUriByAction(
|
||||
this LinkGenerator generator,
|
||||
HttpContext httpContext,
|
||||
|
|
@ -189,6 +197,14 @@ namespace Microsoft.AspNetCore.Routing
|
|||
/// names from <c>RouteOptions</c>.
|
||||
/// </param>
|
||||
/// <returns>A absolute URI, or <c>null</c> if a URI cannot be created.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
|
||||
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
|
||||
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
|
||||
/// your deployment environment.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static string GetUriByAction(
|
||||
this LinkGenerator generator,
|
||||
string action,
|
||||
|
|
|
|||
|
|
@ -135,6 +135,14 @@ namespace Microsoft.AspNetCore.Routing
|
|||
/// names from <c>RouteOptions</c>.
|
||||
/// </param>
|
||||
/// <returns>A absolute URI, or <c>null</c> if a URI cannot be created.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
|
||||
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
|
||||
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
|
||||
/// your deployment environment.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static string GetUriByPage(
|
||||
this LinkGenerator generator,
|
||||
HttpContext httpContext,
|
||||
|
|
@ -186,6 +194,14 @@ namespace Microsoft.AspNetCore.Routing
|
|||
/// names from <c>RouteOptions</c>.
|
||||
/// </param>
|
||||
/// <returns>A absolute URI, or <c>null</c> if a URI cannot be created.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The value of <paramref name="host" /> should be a trusted value. Relying on the value of the current request
|
||||
/// can allow untrusted input to influence the resulting URI unless the <c>Host</c> header has been validated.
|
||||
/// See the deployment documentation for instructions on how to properly validate the <c>Host</c> header in
|
||||
/// your deployment environment.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static string GetUriByPage(
|
||||
this LinkGenerator generator,
|
||||
string page,
|
||||
|
|
|
|||
Loading…
Reference in New Issue