From 32a5826a1fdcb8095e0ff6789d06dcb190212de9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 16 Nov 2021 00:20:50 -0500 Subject: [PATCH] Log more of the response for downloaded PDFs that aren't PDFs --- chrome/content/zotero/xpcom/attachments.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 681dcbb1ed..51e40f98b4 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1127,7 +1127,17 @@ Zotero.Attachments = new function(){ var sample = await Zotero.File.getContentsAsync(path, null, 1000); if (Zotero.MIME.sniffForMIMEType(sample) != 'application/pdf') { Zotero.debug("Downloaded PDF was not a PDF", 2); - Zotero.debug(sample, 3); + if (Zotero.Debug.enabled) { + Zotero.debug( + Zotero.Utilities.ellipsize( + await Zotero.File.getContentsAsync(path), + 20000, + false, + true + ), + 3 + ); + } throw new Zotero.Attachments.InvalidPDFException(); } }