From e3193526fa45424d636f22827a58fb959d044aa9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 22 Apr 2013 15:53:54 -0400 Subject: [PATCH] Fix for WebDAV server returning 300 if lastsync but no lastsync.txt https://forums.zotero.org/discussion/29040/ --- chrome/content/zotero/xpcom/storage/webdav.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index cd4b81b80..a8c13a55f 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -995,10 +995,12 @@ Zotero.Sync.Storage.WebDAV = (function () { }) .then(function () { return Zotero.HTTP.promise("GET", lastSyncURI, - { debug: true, successCodes: [200, 404] }); + { debug: true, successCodes: [200, 300, 404] }); }) .then(function (req) { - if (req.status == 404) { + // If lastsync exists but not lastsync.txt, some servers try to + // be helpful and return 300. + if (req.status == 300 || req.status == 404) { Zotero.debug("No last WebDAV sync file"); // If no lastsync.txt, check previously used 'lastsync',