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