Access-Control-Allow-Origin: * not working?

那年仲夏 提交于 2019-12-04 14:39:00

Enabling Access-Control-Allow-Origin header in the response is not sufficient. Server side implementation should provide proper handling for pre-flight OPTIONS request. Particularly, following HTTP headers must be set in the OPTIONS response:

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

Other HTTP headers such as Access-Control-Allow-Headers might be also needed in OPTIONS response in case non standard HTTP headers are used in your environment.

Have in mind that Access-Control-Allow-Origin: * HTTP header must be also set in the following GET & POST responses.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!