www

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

commit b22b395e22365c29deb1a0132d911ea66e5cd484
parent 9de109db1df75cf315800382ac13a91d34a37769
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 27 Apr 2011 19:08:14 +0000

Fix for occasional "DAV:href '/zotero' does not begin with path '/zotero/'" error on opening Zotero pane with WebDAV syncing enabled


Diffstat:
Mchrome/content/zotero/xpcom/storage/webdav.js | 17++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -1354,6 +1354,16 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.purgeOrphanedStorageFiles = functio href = href.path; } + // Skip root URI + if (href == path + // Some Apache servers respond with an "/zotero" href + // even for a "/zotero/" request + || (trailingSlash && href + '/' == path) + // Try URL-encoded as well, as above + || decodeURIComponent(href) == path) { + continue; + } + if (href.indexOf(path) == -1 // Try URL-encoded as well, in case there's a '~' or similar // character in the URL and the server (e.g., Sakai) is @@ -1363,13 +1373,6 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.purgeOrphanedStorageFiles = functio + "' does not begin with path '" + path + "' in " + funcName); } - // Skip root URI - if (href == path - // Try URL-encoded as well, as above - || decodeURIComponent(href) == path) { - continue; - } - var matches = href.match(/[^\/]+$/); if (!matches) { self.onError("Unexpected href '" + href + "' in " + funcName)