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

This commit is contained in:
Dan Stillman 2011-04-27 19:08:14 +00:00
parent 9de109db1d
commit b22b395e22

View file

@ -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)