Handle PermanentRedirects in PrerenderTagHelpers (#7179)

Handle PermanentRedirects in PrerenderTagHelpers
This commit is contained in:
Ryan Brandenburg 2019-02-05 09:22:40 -08:00 committed by GitHub
parent e3e9b120b3
commit 28b56587b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -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;
} }