www

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

commit a1277ccaa9a227fac0c85285f5b4728e3092bff4
parent d5989a3d1e367d6b960c3d6504543cd6c3beccd4
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 15 Jan 2009 04:24:10 +0000

Bail on attachment save if HEAD request returns a status code other than 200 or 204


Diffstat:
Mchrome/content/zotero/xpcom/attachments.js | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js @@ -192,6 +192,12 @@ Zotero.Attachments = new function(){ } Zotero.Utilities.HTTP.doHead(url, function(obj){ + if (obj.status != 200 && obj.status != 204) { + Zotero.debug("Attachment HEAD request returned with status code " + + obj.status + " in Attachments.importFromURL()", 2); + return false; + } + var mimeType = obj.channel.contentType; var nsIURL = Components.classes["@mozilla.org/network/standard-url;1"]