|
|
@@ -1,6 +1,7 @@
|
|
|
// Licensed to the .NET Foundation under one or more agreements.
|
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
|
|
+using System.Diagnostics.CodeAnalysis;
|
|
|
using System.Linq.Expressions;
|
|
|
using System.Security.Claims;
|
|
|
using System.Text;
|
|
|
@@ -805,7 +806,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="localUrl">The local URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="LocalRedirectResult"/> for the response.</returns>
|
|
|
- public virtual LocalRedirectResult LocalRedirect(string localUrl)
|
|
|
+ public virtual LocalRedirectResult LocalRedirect([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(localUrl))
|
|
|
{
|
|
|
@@ -821,7 +822,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="localUrl">The local URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="LocalRedirectResult"/> for the response.</returns>
|
|
|
- public virtual LocalRedirectResult LocalRedirectPermanent(string localUrl)
|
|
|
+ public virtual LocalRedirectResult LocalRedirectPermanent([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(localUrl))
|
|
|
{
|
|
|
@@ -838,7 +839,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="localUrl">The local URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="LocalRedirectResult"/> for the response.</returns>
|
|
|
- public virtual LocalRedirectResult LocalRedirectPreserveMethod(string localUrl)
|
|
|
+ public virtual LocalRedirectResult LocalRedirectPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(localUrl))
|
|
|
{
|
|
|
@@ -855,7 +856,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="localUrl">The local URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="LocalRedirectResult"/> for the response.</returns>
|
|
|
- public virtual LocalRedirectResult LocalRedirectPermanentPreserveMethod(string localUrl)
|
|
|
+ public virtual LocalRedirectResult LocalRedirectPermanentPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri, UriKind.Relative)] string localUrl)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(localUrl))
|
|
|
{
|
|
|
@@ -916,7 +917,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="url">The URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="RedirectResult"/> for the response.</returns>
|
|
|
- protected internal RedirectResult Redirect(string url)
|
|
|
+ protected internal RedirectResult Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
{
|
|
|
@@ -932,7 +933,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="url">The URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="RedirectResult"/> for the response.</returns>
|
|
|
- public virtual RedirectResult RedirectPermanent(string url)
|
|
|
+ public virtual RedirectResult RedirectPermanent([StringSyntax(StringSyntaxAttribute.Uri)] string url)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
{
|
|
|
@@ -949,7 +950,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="url">The URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="RedirectResult"/> for the response.</returns>
|
|
|
- public virtual RedirectResult RedirectPreserveMethod(string url)
|
|
|
+ public virtual RedirectResult RedirectPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
{
|
|
|
@@ -966,7 +967,7 @@ public abstract class PageModel : IAsyncPageFilter, IPageFilter
|
|
|
/// </summary>
|
|
|
/// <param name="url">The URL to redirect to.</param>
|
|
|
/// <returns>The created <see cref="RedirectResult"/> for the response.</returns>
|
|
|
- public virtual RedirectResult RedirectPermanentPreserveMethod(string url)
|
|
|
+ public virtual RedirectResult RedirectPermanentPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
{
|