From ed673fdba8b2906349ccc782fda74d720f14b539 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 2 Apr 2024 22:40:12 +0200 Subject: [PATCH] Bugfix: mime parser headerValue() is null --- dev/Mime/Parser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/Mime/Parser.js b/dev/Mime/Parser.js index 371101534..eb13c199b 100644 --- a/dev/Mime/Parser.js +++ b/dev/Mime/Parser.js @@ -83,7 +83,7 @@ export function ParseMime(text) get body() { let body = this.bodyRaw, charset = this.header('content-type')?.params.charset, - encoding = this.headerValue('content-transfer-encoding').toLowerCase(); + encoding = this.headerValue('content-transfer-encoding')?.toLowerCase(); if ('quoted-printable' == encoding) { body = QPDecode(body); } else if ('base64' == encoding) { @@ -94,7 +94,7 @@ export function ParseMime(text) get dataUrl() { let body = this.bodyRaw, - encoding = this.headerValue('content-transfer-encoding').toLowerCase(); + encoding = this.headerValue('content-transfer-encoding')?.toLowerCase(); if ('base64' == encoding) { body = body.replace(/\r?\n/g, ''); } else { @@ -112,7 +112,7 @@ export function ParseMime(text) } getByContentType(type) { - if (type == this.headerValue('content-type').toLowerCase()) { + if (type == this.headerValue('content-type')?.toLowerCase()) { return this; } let i = 0, p = this.parts, part;