Closed cincuranet closed 7 years ago
@muratg recomend accept for 1.1.0. Compare to the generic redirect rule: https://github.com/aspnet/BasicMiddleware/blob/03b63e2c2a5ec27deef4be692ff2119188b67d73/src/Microsoft.AspNetCore.Rewrite/Internal/RedirectRule.cs#L56
The tests don't actually check the status code: https://github.com/aspnet/BasicMiddleware/blob/9814f3bfbcf3a11dc86c4047fbfc2fe48744f96c/test/Microsoft.AspNetCore.Rewrite.Tests/MiddlewareTests.cs#L67
(FYI for folks -- I have made the previous triage edits on the bug, not @cincuranet. Looks like there's a GH issue where it appears to put his name instead of mine.)
Good catch @cincuranet . Just fixed this issue in https://github.com/aspnet/BasicMiddleware/pull/173
When using the
AddRedirectToHttps
withstatusCode
, thestatusCode
is ignored. It's always302
. Same applies forAddRedirectToHttpsPermanent
where 301 is expected.I believe the problem is in
RedirectToHttpsRule
class here. It's using theRedirect
, which defaults to302
and theStatusCode
property is ignored.