Revert "Don't set unknown mimeTypes to "application/octet-stream""

This reverts commit f64d087926.
This commit is contained in:
Simon Kornblith 2013-04-07 01:58:33 -04:00
parent 79bfca03ae
commit 0850ca94b1
2 changed files with 4 additions and 2 deletions

View file

@ -330,6 +330,8 @@ Zotero.MIME = new function(){
var mimeType = xmlhttp.channel.contentType;
}
if(!mimeType) mimeType = 'application/octet-stream'; //unknown item type according to RFC 2046 section 4.5.1
var nsIURL = Components.classes["@mozilla.org/network/standard-url;1"]
.createInstance(Components.interfaces.nsIURL);
nsIURL.spec = url;

View file

@ -411,12 +411,12 @@ Zotero.Translate.ItemSaver.prototype = {
// Save attachment if snapshot pref enabled or not HTML
// (in which case downloadAssociatedFiles applies)
} else {
if(!attachment.mimeType && attachment.mimeType !== '') {
if(!attachment.mimeType && attachment.mimeType !== '') { //in case '' indicates unknwon mime type at some point
Zotero.debug("Translate: No mimeType specified for a possible snapshot. Trying to determine mimeType.", 4);
var me = this;
try {
Zotero.MIME.getMIMETypeFromURL(attachment.url, function (mimeType, hasNativeHandler) {
attachment.mimeType = mimeType || '';
attachment.mimeType = mimeType;
me._saveAttachmentDownload(attachment, parentID, attachmentCallback);
}, this._cookieSandbox);
} catch(e) {