fix: fix subdomain retrieval
All checks were successful
Update changelog / changelog (push) Successful in 25s
All checks were successful
Update changelog / changelog (push) Successful in 25s
This commit is contained in:
@@ -91,7 +91,7 @@ AppDataSource.initialize().then(async () => {
|
|||||||
|
|
||||||
// Retrieve url, subdomain from request.
|
// Retrieve url, subdomain from request.
|
||||||
let uri: string = req.url.slice(1); // discards / from /abc, /abc -> abc
|
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
|
// Try to lookup the url in DB
|
||||||
const reversedLink: Link | null = await linkService.lookupUriWithExpiryValidation(uri, subdomain);
|
const reversedLink: Link | null = await linkService.lookupUriWithExpiryValidation(uri, subdomain);
|
||||||
|
|||||||
Reference in New Issue
Block a user