throws an error when formating is invalid
This commit is contained in:
parent
fe6b6c8f47
commit
343541981f
@ -231,18 +231,21 @@ class Mime {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
static _decodeMimeData(input, charEnc, contEnc) {
|
static _decodeMimeData(input, charEnc, contEnc) {
|
||||||
switch (contEnc) {
|
try {
|
||||||
case "base64":
|
switch (contEnc) {
|
||||||
input = Utils.convertToByteArray(input, "base64");
|
case "base64":
|
||||||
break;
|
input = Utils.convertToByteArray(input, "base64");
|
||||||
case "quoted-printable":
|
break;
|
||||||
input = decodeQuotedPrintable(input);
|
case "quoted-printable":
|
||||||
|
input = decodeQuotedPrintable(input);
|
||||||
|
}
|
||||||
|
if (charEnc && MIME_FORMAT.hasOwnProperty(charEnc.toLowerCase())) {
|
||||||
|
input = Utils.strToByteArray(cptable.utils.decode(MIME_FORMAT[charEnc.toLowerCase()], input));
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
} catch (err) {
|
||||||
|
throw new OperationError("Invalid Mime Format");
|
||||||
}
|
}
|
||||||
if (charEnc && MIME_FORMAT.hasOwnProperty(charEnc.toLowerCase())) {
|
|
||||||
input = Utils.strToByteArray(cptable.utils.decode(MIME_FORMAT[charEnc.toLowerCase()], input));
|
|
||||||
|
|
||||||
}
|
|
||||||
return input;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user