我在使用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
都是本地主机的别名,因为我当前正在开发该应用程序。
这里怎么了?
感谢您的帮助