From 8276a769e68213dc6799d4750fac0bf29e4f0f66 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 3 Apr 2023 20:22:23 -0700 Subject: [PATCH] Remove www from domain. --- pages/api/send.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/send.ts b/pages/api/send.ts index 05901f92..51ddb980 100644 --- a/pages/api/send.ts +++ b/pages/api/send.ts @@ -121,7 +121,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => { const refUrl = new URL(referrer); referrerPath = refUrl.pathname; referrerQuery = refUrl.search.substring(1); - referrerDomain = refUrl.hostname; + referrerDomain = refUrl.hostname.replace(/www\./, ''); } if (process.env.REMOVE_TRAILING_SLASH) {