@@ -17,6 +17,22 @@ describe("inert rendering and output", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("embeds only explicitly supplied safe CID image bytes", () => {
|
||||
const output = sanitizeMailHtml(
|
||||
'<img src="cid:logo@example.test"><img src="https://bad.test/pixel">',
|
||||
[
|
||||
{
|
||||
contentId: "logo@example.test",
|
||||
mediaType: "image/png",
|
||||
bytes: new Uint8Array([1, 2, 3]),
|
||||
},
|
||||
],
|
||||
);
|
||||
expect(output).toContain("data:image/png;base64,AQID");
|
||||
expect(output).not.toContain("bad.test");
|
||||
expect(output).not.toContain("cid:");
|
||||
});
|
||||
|
||||
it("produces a bounded line comparison", () => {
|
||||
expect(compareBodies("a\nb", "a\nc")).toMatchObject({
|
||||
added: 1,
|
||||
|
||||
Reference in New Issue
Block a user