Access-Control-Allow-Headers设置为*,但在Firefox中仍然失败

时间:2018-10-11 00:44:02

标签: cors preflight

我一直在使用Angular开发前端和PHP的API的Slim框架来开发一个新站点。我一直在Chrome(和Postman)中进行开发,没有任何问题。我今天在Firefox中进行了测试,所有API响应均失败,并显示以下错误:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.opweekends.local/users/authenticate. (Reason: missing token ‘content-type’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).

我将Access-Control-Allow-Headers设置为*(并在控制台中进行了验证),所以我不知道为什么它可以在Chrome而不是Firefox中运行,以及为什么会出现此错误。 *是否应该覆盖所有标头?

0 个答案:

没有答案
相关问题