From e1e21a4f3948ba84da66ee6a8c96113ccec9a4f4 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 1 Sep 2011 07:50:53 +0000 Subject: [PATCH] Fix bug in last commit --- chrome/content/zotero/xpcom/server.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/server.js b/chrome/content/zotero/xpcom/server.js index ec0799506..3d69d070c 100755 --- a/chrome/content/zotero/xpcom/server.js +++ b/chrome/content/zotero/xpcom/server.js @@ -295,12 +295,11 @@ Zotero.Server.DataListener.prototype._generateResponse = function(status, conten response += "X-Zotero-Connector-API-Version: "+CONNECTOR_API_VERSION+"\r\n"; const originRe = /[\r\n]Origin: +([^ \r\n]+)/i; - Zotero.debug(this.header); var m = originRe.exec(this.header); 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"; + response += "Access-Control-Allow-Origin: "+m[1]+"\r\n"; + response += "Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n"; + response += "Access-Control-Allow-Headers: Content-Type,X-Zotero-Connector-API-Version,X-Zotero-Version\r\n"; } }