* fix: use WEBAPP_URL for booking URLs when domains differ For EU deployments where WEBAPP_URL (app.cal.eu) differs from WEBSITE_URL (cal.com), use WEBAPP_URL for non-org booking URLs. This fixes incorrect bookingUrl in API responses for EU instance. * Created new shared utility getTldPlus1 and updated code to use shared function instead of inline copy * use same comment
8 lines
346 B
TypeScript
8 lines
346 B
TypeScript
/**
|
|
* Note: It doesn't support multipart tlds like .co.uk and thus makes only one part tld's safe like .com(and thus cal.com)
|
|
* If we want to use it elsewhere as well(apart from embed/preview.ts) we must consider Public Suffix List
|
|
*/
|
|
export function getTldPlus1(hostname: string): string {
|
|
return hostname.split(".").slice(-2).join(".");
|
|
}
|