一个很老的程序,重定向是程序中判断到未登录时要求去登录页,结果发现变成了 http ,很奇怪。
一个很老的程序,重定向是程序中判断到未登录时要求去登录页,结果发现变成了 http ,很奇怪。
|
1
下面是我用的办法给你参考下
```java /** * 创建一个重定向的 View ,并且防止从 HTTPS 跳转成为 HTTP */ protected ModelAndView safeRedirect(String url) { return new ModelAndView(new RedirectView(url, true, false)); } ``` |
|
2
|
|
iyiluoMay 25, 2023
3
看前端 302 重定向的 location 跳转链接是不是 htttp 开头,如果应用用 nginx 代理了,可以在 nginx 配置把 http 跳转改成 https 跳转
|