From 9ed8bed7784850fea25a1f769a23353eb115ab9b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 11 Dec 2018 16:02:57 -0500 Subject: [PATCH] Find direct PDF from page URL if Content-Type includes invalid parameter The 'application/pdf' Content-Type shouldn't have any parameters, but a site was returning 'application/pdf;charset=ISO-8859-1', so instead just look for the 'application/pdf' prefix. --- chrome/content/zotero/xpcom/attachments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index a9d8d7fba8..38df20e4b1 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1762,7 +1762,7 @@ Zotero.Attachments = new function(){ } // If DOI resolves directly to a PDF, save it to disk - if (contentType == 'application/pdf') { + if (contentType.startsWith('application/pdf')) { Zotero.debug("URL resolves directly to PDF"); await Zotero.File.putContentsAsync(path, blob); await _enforcePDF(path);