https我在网站示例上使用 laravel 创建一个网络: https://examples.com。我有一个刀片视图,它具有form对另一个页面的操作,https://examples.com/next
我在我的刀片文件中使用了它:<form action="{{url("next")}}" method="POST" id="page">。
但是当我在浏览器上测试时,它会显示如下警告:
Mixed Content: The page at 'https://examples.com' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://examples.com/next'. This endpoint should be made available over a secure connection.
当我检查时<form>,它显示<form action="http://examples.com/next" method="POST" id="page">
有人对此有想法吗?谢谢
url()laravel 中的 helper 根据请求的协议自动使用 http/https。如果页面是,https://examples.com它应该生成https链接。
如果存在切换协议的代理,则可能会发生该错误。在这种情况下,你有两个选择。
本地解决方案
<form action="{{secure_url("next")}}" method="POST" id="page">
Run Code Online (Sandbox Code Playgroud)
全球解决方案
<form action="{{secure_url("next")}}" method="POST" id="page">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2580 次 |
| 最近记录: |