From 681555fef8187957ba9a01c9229af5c12bafb6d0 Mon Sep 17 00:00:00 2001 From: sherl Date: Thu, 8 Jan 2026 13:20:32 +0100 Subject: [PATCH] fix: fix subdomain retrieval --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index d521695..7f21e4e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -91,7 +91,7 @@ AppDataSource.initialize().then(async () => { // Retrieve url, subdomain from request. let uri: string = req.url.slice(1); // discards / from /abc, /abc -> abc - let subdomain: string | null = req.headers.host!.replace(rs.fqdn, '') || null; + let subdomain: string | null = req.headers.host!.replace(rs.fqdn, '').slice(0, -1) || null; // slice() to remove trailing dot // Try to lookup the url in DB const reversedLink: Link | null = await linkService.lookupUriWithExpiryValidation(uri, subdomain);