Handle PermanentRedirects in PrerenderTagHelpers (#7179)
Handle PermanentRedirects in PrerenderTagHelpers
This commit is contained in:
parent
e3e9b120b3
commit
28b56587b1
|
|
@ -102,7 +102,8 @@ namespace Microsoft.AspNetCore.SpaServices.Prerendering
|
||||||
if (!string.IsNullOrEmpty(result.RedirectUrl))
|
if (!string.IsNullOrEmpty(result.RedirectUrl))
|
||||||
{
|
{
|
||||||
// It's a redirection
|
// It's a redirection
|
||||||
ViewContext.HttpContext.Response.Redirect(result.RedirectUrl);
|
var permanentRedirect = result.StatusCode.GetValueOrDefault() == 301;
|
||||||
|
ViewContext.HttpContext.Response.Redirect(result.RedirectUrl, permanentRedirect);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue