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/D222966
This commit is contained in:
Calixte 2024-09-20 14:55:28 +00:00
parent 99a9aef629
commit d7b973bf02

View file

@ -883,6 +883,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