From c89bb7ae4c8836a99442847671d9953ee8a413eb Mon Sep 17 00:00:00 2001 From: Tino Hager Date: Mon, 22 Jul 2024 23:02:33 +0200 Subject: [PATCH] optimize header split logic --- src/Frontend/src/helpers/mailHelper.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Frontend/src/helpers/mailHelper.ts b/src/Frontend/src/helpers/mailHelper.ts index 682d8db..9312481 100644 --- a/src/Frontend/src/helpers/mailHelper.ts +++ b/src/Frontend/src/helpers/mailHelper.ts @@ -154,9 +154,12 @@ function decodeMailHeader (mailHeader: string, headerIndex: number): HeaderDetai const indexOfFirstColon = encodedMailHeader.indexOf(':') + const headerName = encodedMailHeader.slice(0, indexOfFirstColon).trim() + const headerData = encodedMailHeader.slice(indexOfFirstColon + 1).trim() + return { - headerName: encodedMailHeader.slice(0, indexOfFirstColon), - headerData: encodedMailHeader.slice(indexOfFirstColon + 2), + headerName, + headerData, headerIndex } }