首页 新闻 会员 周边

没有使用 UseHttpsRedirection 却强制跳转 https

0
悬赏园豆:30 [已解决问题] 解决于 2023-03-03 12:18

在一个 ASP.NET Core 7.0 项目中,Program 中没有 app.UseHttpsRedirection(),但请求 localhost 地址时依然强制跳转 https

root@8c6af80eeb1e:/app# curl -i localhost/     
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Date: Fri, 03 Mar 2023 01:53:43 GMT
Server: Kestrel
Location: https://localhost/
dudu的主页 dudu | 高人七级 | 园豆:31007
提问于:2023-03-03 10:07
< >
分享
最佳答案
0

是一个 url 重写规则引起的

var rewriteOptions = new RewriteOptions()
     .AddRedirectToHttpsPermanent();
dudu | 高人七级 |园豆:31007 | 2023-03-03 12:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册