www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 771cfc9ca6204c209dc50a30b57cc50360c50b45
parent 11316d952b836d193012421ed51f64dc84521b49
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 15 Apr 2013 13:43:07 -0400

Make bookmarklet origin configurable for tests

Diffstat:
Mchrome/content/zotero/xpcom/server.js | 3++-
Mchrome/content/zotero/xpcom/zotero.js | 2++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/server.js b/chrome/content/zotero/xpcom/server.js @@ -306,7 +306,8 @@ Zotero.Server.DataListener.prototype._generateResponse = function(status, conten if(!Zotero.isServer) { response += "X-Zotero-Version: "+Zotero.version+"\r\n"; response += "X-Zotero-Connector-API-Version: "+CONNECTOR_API_VERSION+"\r\n"; - if(this.origin === "https://www.zotero.org" || this.origin === "http://www.zotero.org") { + if(this.origin === ZOTERO_CONFIG.BOOKMARKLET_ORIGIN || + this.origin === ZOTERO_CONFIG.HTTP_BOOKMARKLET_ORIGIN) { response += "Access-Control-Allow-Origin: "+this.origin+"\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"; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -35,6 +35,8 @@ const ZOTERO_CONFIG = { API_URL: 'https://api.zotero.org/', API_VERSION: 2, PREF_BRANCH: 'extensions.zotero.', + BOOKMARKLET_ORIGIN : 'https://www.zotero.org', + HTTP_BOOKMARKLET_ORIGIN : 'http://www.zotero.org', BOOKMARKLET_URL: 'https://www.zotero.org/bookmarklet/', VERSION: "4.0.5.SOURCE" };