Skip to content
Snippets Groups Projects

Resolve "Email integrity check"

Merged Damyan Mitev requested to merge 46-email-integrity-check into master
4 files
+ 223
12
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -61,7 +61,7 @@ function calculateParts(body, from, to, previousBondary) {
let boundary = findFirstBoundary(body, from, to);
if (boundary == null) {
return [{ indices: { from: from, to: to }, boundary: previousBondary }];
return [{ indices: { from: from, to: to }, boundary: previousBondary, leaf: true }];
}
const realBoundary = boundary;
@@ -78,6 +78,9 @@ function calculateParts(body, from, to, previousBondary) {
}
let bodies = [];
if (previousBondary !== null) {
bodies.push({indices: {from: from, to: to}, boundary: previousBondary, leaf: false});
}
for (let i = 0; i < boundaryIndicesLength - 1; i++) {
const firstPair = boundaryPairs[i];
@@ -155,13 +158,14 @@ export function parseMIME(mime) {
parts.push({
indices: { from: 0, to: mime.length, headersEnd: headersEnd },
headers,
boundary: "mimemessage"
boundary: "mimemessage",
leaf: false
});
return parts;
}
function getHeaderValue(header, part) {
export function getHeaderValue(header, part) {
if (part.headers && part.headers[header] && part.headers[header].length) {
return part.headers[header];
}
Loading