Https Redirect: Change default status code to 307. #210
This commit is contained in:
parent
b22f4b11b9
commit
0cace7688d
|
|
@ -11,9 +11,9 @@ namespace Microsoft.AspNetCore.HttpsPolicy
|
|||
public class HttpsRedirectionOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// The status code to redirect the response to.
|
||||
/// The status code used for the redirect response. The default is 307.
|
||||
/// </summary>
|
||||
public int RedirectStatusCode { get; set; } = StatusCodes.Status302Found;
|
||||
public int RedirectStatusCode { get; set; } = StatusCodes.Status307TemporaryRedirect;
|
||||
|
||||
/// <summary>
|
||||
/// The HTTPS port to be added to the redirected URL.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.HttpsPolicy.Tests
|
|||
|
||||
var response = await client.SendAsync(request);
|
||||
|
||||
Assert.Equal(HttpStatusCode.Found, response.StatusCode);
|
||||
Assert.Equal(HttpStatusCode.RedirectKeepVerb, response.StatusCode);
|
||||
Assert.Equal("https://localhost/", response.Headers.Location.ToString());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue