Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

remove trailing slash from cors & domain in validate

Carl-Gerhard Lindesvärdf70cdee93468
diff --git a/apps/api/src/utils/auth.ts b/apps/api/src/utils/auth.ts
index 9eaf8535d..ed648bc49 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']