Don't set unknown mimeTypes to "application/octet-stream"
This commit is contained in:
parent
6dd94f0a3a
commit
f64d087926
|
@ -330,8 +330,6 @@ Zotero.MIME = new function(){
|
||||||
var mimeType = xmlhttp.channel.contentType;
|
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"]
|
var nsIURL = Components.classes["@mozilla.org/network/standard-url;1"]
|
||||||
.createInstance(Components.interfaces.nsIURL);
|
.createInstance(Components.interfaces.nsIURL);
|
||||||
nsIURL.spec = url;
|
nsIURL.spec = url;
|
||||||
|
|
|
@ -405,12 +405,12 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
// Save attachment if snapshot pref enabled or not HTML
|
// Save attachment if snapshot pref enabled or not HTML
|
||||||
// (in which case downloadAssociatedFiles applies)
|
// (in which case downloadAssociatedFiles applies)
|
||||||
} else {
|
} else {
|
||||||
if(!attachment.mimeType && attachment.mimeType !== '') { //in case '' indicates unknwon mime type at some point
|
if(!attachment.mimeType && attachment.mimeType !== '') {
|
||||||
Zotero.debug("Translate: No mimeType specified for a possible snapshot. Trying to determine mimeType.", 4);
|
Zotero.debug("Translate: No mimeType specified for a possible snapshot. Trying to determine mimeType.", 4);
|
||||||
var me = this;
|
var me = this;
|
||||||
try {
|
try {
|
||||||
Zotero.MIME.getMIMETypeFromURL(attachment.url, function (mimeType, hasNativeHandler) {
|
Zotero.MIME.getMIMETypeFromURL(attachment.url, function (mimeType, hasNativeHandler) {
|
||||||
attachment.mimeType = mimeType;
|
attachment.mimeType = mimeType || '';
|
||||||
me._saveAttachmentDownload(attachment, parentID, attachmentCallback);
|
me._saveAttachmentDownload(attachment, parentID, attachmentCallback);
|
||||||
}, this._cookieSandbox);
|
}, this._cookieSandbox);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user