From 8d483d92830cda0efa15d5c54d42a26168004077 Mon Sep 17 00:00:00 2001 From: Eritque arcus Date: Thu, 22 May 2025 00:19:50 -0500 Subject: [PATCH 1/2] fix: hash is not included in record --- src/app/api/send/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/send/route.ts b/src/app/api/send/route.ts index 60d6f7af..9d41a68f 100644 --- a/src/app/api/send/route.ts +++ b/src/app/api/send/route.ts @@ -145,7 +145,7 @@ export async function POST(request: Request) { const base = hostname ? `https://${hostname}` : 'https://localhost'; const currentUrl = new URL(url, base); - let urlPath = currentUrl.pathname === '/undefined' ? '' : currentUrl.pathname; + let urlPath = currentUrl.pathname === '/undefined' ? '' : currentUrl.pathname + currentUrl.hash; const urlQuery = currentUrl.search.substring(1); const urlDomain = currentUrl.hostname.replace(/^www./, ''); From 33110a44ec1c04896e4b6f06ba7773156901b6d6 Mon Sep 17 00:00:00 2001 From: Eritque arcus Date: Thu, 22 May 2025 00:24:48 -0500 Subject: [PATCH 2/2] fix: fix remove trailing slash regex --- src/app/api/send/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/send/route.ts b/src/app/api/send/route.ts index 9d41a68f..65c88a28 100644 --- a/src/app/api/send/route.ts +++ b/src/app/api/send/route.ts @@ -169,7 +169,7 @@ export async function POST(request: Request) { const twclid = currentUrl.searchParams.get('twclid'); if (process.env.REMOVE_TRAILING_SLASH) { - urlPath = urlPath.replace(/(.+)\/$/, '$1'); + urlPath = urlPath.replace(/\/(?=(#.*)?$)/, ''); } if (referrer) {