From 05c9e061dc4a65a17dbe43ba6c47a3f05f454331 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 24 Sep 2023 20:42:26 +0100 Subject: [PATCH] Fix for issue: https://git.fjla.uk/OwlBoard/backend/issues/44 Signed-off-by: Fred Boniface --- src/utils/sanitizer.utils.ts | 2 +- test/utils/sanitizer.utils.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/sanitizer.utils.ts b/src/utils/sanitizer.utils.ts index 4115525..9619536 100644 --- a/src/utils/sanitizer.utils.ts +++ b/src/utils/sanitizer.utils.ts @@ -24,7 +24,7 @@ function cleanNrcc(input: string) { function getDomainFromEmail(mail: string) { // Needs testing let split = mail.split("@"); - return split[1]; + return split[1].toLowerCase(); } module.exports = { diff --git a/test/utils/sanitizer.utils.test.ts b/test/utils/sanitizer.utils.test.ts index 8bd7b59..19ff938 100644 --- a/test/utils/sanitizer.utils.test.ts +++ b/test/utils/sanitizer.utils.test.ts @@ -9,6 +9,7 @@ describe("Sanitize Email", () => { "I%Have{Special}%Characters@example.com", "Basic.address@example.com", `"very.(),:;<>[]\".VERY.\"very\ \"very\".unusual"@example.com`, + "THIS_EMAIL_CONTAINS_CAPITALISED_DOMAIN@EXAMPLE.COM" ]; const expectedOutput = "example.com"; for (const addr of inputs) {