From: Chocobozzz Date: Thu, 9 Sep 2021 07:13:45 +0000 (+0200) Subject: Fix config injection with custom HTML/CSS X-Git-Tag: v3.4.0~7 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b4c945f3c727d1ce5de5a4af69d6dfa14c83468e;p=github%2FChocobozzz%2FPeerTube.git Fix config injection with custom HTML/CSS --- diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 3b0a68f4d..3529acf5e 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -382,8 +382,9 @@ class ClientHtml { } private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) { - const serverConfigString = JSON.stringify(serverConfig) - const configScriptTag = `` + // Stringify the JSON object, and then stringify the string object so we can inject it into the HTML + const serverConfigString = JSON.stringify(JSON.stringify(serverConfig)) + const configScriptTag = `` return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag) }