remove trailing slash from cors & domain in validate

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-13 12:05:15 +01:00
parent c1a6c0a191
commit f70cdee934

View File

@@ -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']