解析客户端API密钥导致Angular应用程序中的CORS异常

时间:2015-05-14 19:13:43

标签: angularjs cordova parse-platform cors angular-resource

我创建了一个使用Parse.com rest API的应用。我使用$ resource创建了一个工厂,用于定义带有所需parse.com头的get。

当我使用解析头X-Parse-REST-API-Key运行此应用程序时,它按预期工作,但是当我使用X-Parse-Client-Key时,应用程序会抛出CORS错误:

Category.all

这些标题适用于Chrome的Postman上的客户端密钥。我还检查了config.xml以确保Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.parse.com/1/classes/Games. This can be fixed by moving the resource to the same domain or enabling CORS. >

我想使用客户端密钥,因为Parse文档警告不要在客户端上使用rest-api密钥......

1 个答案:

答案 0 :(得分:0)

我最终使用Rest键而不是客户端密钥,因为我无法更改parse.com服务的设置!