Changed RequireHttpsAttribute to default to 302 instead of 301

This commit is contained in:
Kristian Hellang 2016-05-02 20:50:06 +02:00 committed by Kiran Challa
parent 3aa42617a4
commit f4679fe74f
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Mvc
request.QueryString.ToUriComponent());
// redirect to HTTPS version of page
filterContext.Result = new RedirectResult(newUrl, permanent: true);
filterContext.Result = new RedirectResult(newUrl, permanent: false);
}
}
}

View File

@ -99,7 +99,7 @@ namespace Microsoft.AspNetCore.Mvc
Assert.NotNull(authContext.Result);
var result = Assert.IsType<RedirectResult>(authContext.Result);
Assert.True(result.Permanent);
Assert.False(result.Permanent);
Assert.Equal(expectedUrl, result.Url);
}
@ -216,4 +216,4 @@ namespace Microsoft.AspNetCore.Mvc
return services.BuildServiceProvider();
}
}
}
}

View File

@ -178,7 +178,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
var response = await Client.GetAsync("Home/HttpsOnlyAction");
// Assert
Assert.Equal(HttpStatusCode.MovedPermanently, response.StatusCode);
Assert.Equal(HttpStatusCode.Found, response.StatusCode);
Assert.NotNull(response.Headers.Location);
Assert.Equal("https://localhost/Home/HttpsOnlyAction", response.Headers.Location.ToString());
Assert.Equal(0, response.Content.Headers.ContentLength);