Fix conditional

This commit is contained in:
Simon Kornblith 2011-09-01 07:04:46 +00:00
parent 92378313f7
commit 6fe0ea6a90

View file

@ -316,7 +316,7 @@ Zotero.Server.DataListener.prototype._processEndpoint = function(method, postDat
var headers = "";
const originRe = /[\r\n]Origin: +([^ \r\n]+)/i;
var m = originRe.exec(this.header);
if(m && m[1] === "https://www.zotero.org" || m[1] === "http://www.zotero.org") { Zotero.debug(m[1]);
if(m && (m[1] === "https://www.zotero.org" || m[1] === "http://www.zotero.org")) {
headers += "Access-Control-Allow-Origin: "+m[1]+"\r\n";
headers += "Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n";
headers += "Access-Control-Allow-Headers: Content-Type,X-Zotero-Connector-API-Version,X-Zotero-Version\r\n";