Bug 1918301 - Don't display pdfs in pdf.js coming from a multipart response r=valentin, a=dsmith

Original Revision: https://phabricator.services.mozilla.com/D222122

Differential Revision: https://phabricator.services.mozilla.com/D222965
This commit is contained in:
Calixte 2024-09-20 14:53:04 +00:00
parent 051dcb8006
commit 6e8199d485

View File

@ -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