diff --git a/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program2.cs b/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program2.cs index 70e89c1d64..95721f4fc1 100644 --- a/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program2.cs +++ b/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program2.cs @@ -1,4 +1,4 @@ -using System.Net; +using static Microsoft.AspNetCore.Http.StatusCodes; var builder = WebApplication.CreateBuilder(args); @@ -15,7 +15,7 @@ builder.Services.AddHsts(options => builder.Services.AddHttpsRedirection(options => { - options.RedirectStatusCode = (int)HttpStatusCode.TemporaryRedirect; + options.RedirectStatusCode = Status307TemporaryRedirect; options.HttpsPort = 5001; }); diff --git a/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program3.cs b/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program3.cs index b75d4093a1..be6a8491be 100644 --- a/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program3.cs +++ b/aspnetcore/security/enforcing-ssl/sample-snapshot/6.x/Program3.cs @@ -1,4 +1,4 @@ -using System.Net; +using static Microsoft.AspNetCore.Http.StatusCodes; var builder = WebApplication.CreateBuilder(args); @@ -8,7 +8,7 @@ if (!builder.Environment.IsDevelopment()) { builder.Services.AddHttpsRedirection(options => { - options.RedirectStatusCode = (int)HttpStatusCode.PermanentRedirect; + options.RedirectStatusCode = Status308PermanentRedirect; options.HttpsPort = 443; }); }