diff --git a/chrome/content/zotero/xpcom/sync/syncAPIClient.js b/chrome/content/zotero/xpcom/sync/syncAPIClient.js index 1825fdaa4..2a0f9b073 100644 --- a/chrome/content/zotero/xpcom/sync/syncAPIClient.js +++ b/chrome/content/zotero/xpcom/sync/syncAPIClient.js @@ -47,7 +47,7 @@ Zotero.Sync.APIClient.prototype = { getKeyInfo: Zotero.Promise.coroutine(function* (options={}) { - var uri = this.baseURL + "keys/" + this.apiKey; + var uri = this.baseURL + "keys/current"; let opts = {}; Object.assign(opts, options); opts.successCodes = [200, 404]; @@ -518,7 +518,7 @@ Zotero.Sync.APIClient.prototype = { // Deletes current API key deleteAPIKey: Zotero.Promise.coroutine(function* () { - yield this.makeRequest("DELETE", this.baseURL + "keys/" + this.apiKey); + yield this.makeRequest("DELETE", this.baseURL + "keys/current"); }), diff --git a/test/tests/syncRunnerTest.js b/test/tests/syncRunnerTest.js index ae9ce47be..abab4b71f 100644 --- a/test/tests/syncRunnerTest.js +++ b/test/tests/syncRunnerTest.js @@ -11,7 +11,7 @@ describe("Zotero.Sync.Runner", function () { keyInfo: { fullAccess: { method: "GET", - url: "keys/" + apiKey, + url: "keys/current", status: 200, json: { key: apiKey, @@ -729,7 +729,8 @@ describe("Zotero.Sync.Runner", function () { server.respond(function (req) { if (req.method == "DELETE") { - assert.equal(req.url, baseURL + "keys/" + apiKey); + assert.propertyVal(req.requestHeaders, 'Zotero-API-Key', apiKey); + assert.equal(req.url, baseURL + "keys/current"); } req.respond(204); });