From f70cdee9346863768532d48ea326bd5bb402ca2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Wed, 13 Mar 2024 12:05:15 +0100 Subject: [PATCH] remove trailing slash from cors & domain in validate --- apps/api/src/utils/auth.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/utils/auth.ts b/apps/api/src/utils/auth.ts index 9eaf8535..ed648bc4 100644 --- a/apps/api/src/utils/auth.ts +++ b/apps/api/src/utils/auth.ts @@ -6,7 +6,10 @@ import { db } from '@openpanel/db'; import { logger } from './logger'; const cleanDomain = (domain: string) => - domain.replace('www.', '').replace(/https?:\/\//, ''); + domain + .replace('www.', '') + .replace(/https?:\/\//, '') + .replace(/\/$/, ''); export async function validateSdkRequest( headers: RawRequestDefaultExpression['headers']