diff --git a/apps/web/pages/_document.tsx b/apps/web/pages/_document.tsx index a4d5488c66..1b9254c304 100644 --- a/apps/web/pages/_document.tsx +++ b/apps/web/pages/_document.tsx @@ -1,7 +1,6 @@ import type { DocumentContext, DocumentProps } from "next/document"; import Document, { Head, Html, Main, NextScript } from "next/document"; import Script from "next/script"; -import { cloneElement } from "react"; import { z } from "zod"; import { getDirFromLang } from "@calcom/lib/i18n"; @@ -9,17 +8,6 @@ import { getDirFromLang } from "@calcom/lib/i18n"; import { csp } from "@lib/csp"; type Props = Record & DocumentProps; -// So that bots without referrer header have the referrerpolicy set explicitly by the script tag -class CustomHead extends Head { - getScripts(files: Parameters[0]) { - const originalScripts = super.getScripts(files); - return originalScripts.map((script) => { - return cloneElement(script, { - referrerpolicy: "strict-origin-when-cross-origin", - }); - }); - } -} class MyDocument extends Document { static async getInitialProps(ctx: DocumentContext) { @@ -46,19 +34,21 @@ class MyDocument extends Document { const dir = getDirFromLang(locale); return ( - + + {/* So that our rewrite logic depending on the `referrer` header is always set: */} + - +