www

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

commit 54c0b40870a50ba81bd096169528666c611dbdda
parent c44b7a5c14b471e52de7e623f1d675c5208096d6
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat,  6 Feb 2010 16:36:02 +0000

Throw error on invalid 200 response to HEAD request, which you might argue shouldn't be possible


Diffstat:
Mchrome/content/zotero/xpcom/storage/zfs.js | 26+++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js @@ -130,23 +130,27 @@ Zotero.Sync.Storage.Session.ZFS.prototype._getStorageFileInfo = function (item, var info = {}; info.hash = req.getResponseHeader('ETag'); + if (!info.hash) { + var msg = "Hash not found in HEAD response in " + funcName + + " (" + Zotero.Items.getLibraryKeyHash(item) + ")"; + Zotero.debug(msg, 1); + Zotero.debug(req.responseText); + Components.utils.reportError(msg); + try { + Zotero.debug(req.getAllResponseHeaders()); + } + catch (e) { + Zotero.debug("Response headers unavailable"); + } + self.onError(); + return; + } info.filename = req.getResponseHeader('X-Zotero-Filename'); var mtime = req.getResponseHeader('X-Zotero-Modification-Time'); info.mtime = parseInt(mtime); info.compressed = req.getResponseHeader('X-Zotero-Compressed') == 'Yes'; Zotero.debug(info); - if (!info.hash) { - Zotero.debug('========'); - Zotero.debug("Hash not found in HEAD response in " + funcName, 2); - Zotero.debug(req.status); - Zotero.debug(item.key); - Zotero.debug(req.responseText); - Zotero.debug(req.getAllResponseHeaders()); - //callback(item, false); - //return; - } - callback(item, info); }); }