fix: Embed - app.cal.com instead of cal.com (#11384)

* Fix yarn.lock

* Force app.cal.com because Safari and rewrites using referrer

* Add comment
pull/11387/head^2
Hariom Balhara 2023-09-15 19:24:25 +05:30 committed by GitHub
parent f35f506ddf
commit d349f6536a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -278,7 +278,12 @@ export class Cal {
} }
} }
const urlInstance = new URL(`${calOrigin || config.calOrigin}/${calLink}`); // cal.com has rewrite issues on Safari that sometimes cause 404 for assets.
const originToUse = (calOrigin || config.calOrigin || "").replace(
"https://cal.com",
"https://app.cal.com"
);
const urlInstance = new URL(`${originToUse}/${calLink}`);
if (!urlInstance.pathname.endsWith("embed")) { if (!urlInstance.pathname.endsWith("embed")) {
// TODO: Make a list of patterns that are embeddable. All except that should be allowed with a warning that "The page isn't optimized for embedding" // TODO: Make a list of patterns that are embeddable. All except that should be allowed with a warning that "The page isn't optimized for embedding"
urlInstance.pathname = `${urlInstance.pathname}/embed`; urlInstance.pathname = `${urlInstance.pathname}/embed`;