diff --git a/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs b/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs index 7f9eea1b45ed..4ed8b361df50 100644 --- a/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs +++ b/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs @@ -982,6 +982,13 @@ PdfStreamConverter.prototype = { }, getConvertedType(aFromType, aChannel) { + if (aChannel instanceof Ci.nsIMultiPartChannel) { + throw new Components.Exception( + "PDF.js doesn't support multipart responses.", + Cr.NS_ERROR_NOT_IMPLEMENTED + ); + } + const HTML = "text/html"; let channelURI = aChannel?.URI; // We can be invoked for application/octet-stream; check if we want the