CORS标头缺少Laravel错误

问题描述 投票:0回答:1

我在使用chrome的javascript中遇到以下错误。

Access to XMLHttpRequest at 'http://stream.example.com/' from origin 'http://test.example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

http://stream.example.com/具有以下标题

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: *

http://stream.example.com/http://test.example.com都是本地主机的别名,因为我当前正在开发该应用程序。

这里怎么了?

感谢您的帮助

php laravel php-7
1个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.