我正在构建一个 Campfire 客户端,它将在 WebOS 中运行并作为 Chrome 桌面网络应用程序运行。我有以下代码:
logIn: function(){
this.apiToken = this.$.loginScreen.$.apiToken.getValue();
this.subdomain = this.$.loginScreen.$.subdomain.getValue();
this.fullURL = 'https://' + this.subdomain + '.campfirenow.com/';
this.$.roomService.url = this.fullURL + 'rooms.json';
var response = this.$.roomService.send({'Authorization': "Bearer " + this.apiToken, 'Access-Control-Allow-Origin': this.subdomain + '.campfirenow.com'});
'roomService' 是这样的:
{name: "roomService", kind: "enyo.WebService", url: null, onResponse: "successfulAlert", onError: "someFailure"}
在 Chromium 中,我不断收到以下 XMLHttpRequest 错误:
Origin null is not allowed by Access-Control-Allow-Origin.
有任何想法吗?