diff --git a/chrome/content/zotero/xpcom/sync/syncAPIClient.js b/chrome/content/zotero/xpcom/sync/syncAPIClient.js index 5a6fce1115..19cf644d05 100644 --- a/chrome/content/zotero/xpcom/sync/syncAPIClient.js +++ b/chrome/content/zotero/xpcom/sync/syncAPIClient.js @@ -820,7 +820,7 @@ Zotero.Sync.APIClient.prototype = { _checkBackoff: function (xmlhttp) { var backoff = xmlhttp.getResponseHeader("Backoff"); - if (backoff && Number.isInteger(backoff)) { + if (backoff && parseInt(backoff) == backoff) { // TODO: Update status? this.caller.pause(backoff * 1000); } @@ -831,7 +831,7 @@ Zotero.Sync.APIClient.prototype = { var retryAfter = xmlhttp.getResponseHeader("Retry-After"); var delay; if (!retryAfter) return false; - if (!Number.isInteger(retryAfter)) { + if (parseInt(retryAfter) != retryAfter) { Zotero.logError(`Invalid Retry-After delay ${retryAfter}`); return false; } diff --git a/test/tests/syncAPIClientTest.js b/test/tests/syncAPIClientTest.js index ddbffa0416..f3a4e9d795 100644 --- a/test/tests/syncAPIClientTest.js +++ b/test/tests/syncAPIClientTest.js @@ -174,7 +174,7 @@ describe("Zotero.Sync.APIClient", function () { req.respond( 503, { - "Retry-After": 5 + "Retry-After": "5" }, "" ); @@ -183,7 +183,7 @@ describe("Zotero.Sync.APIClient", function () { req.respond( 503, { - "Retry-After": 10 + "Retry-After": "10" }, "" );