aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/lib/client-html.ts5
1 files changed, 3 insertions, 2 deletions
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 {
382 } 382 }
383 383
384 private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) { 384 private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) {
385 const serverConfigString = JSON.stringify(serverConfig) 385 // Stringify the JSON object, and then stringify the string object so we can inject it into the HTML
386 const configScriptTag = `<script type="application/javascript">window.PeerTubeServerConfig = '${serverConfigString}'</script>` 386 const serverConfigString = JSON.stringify(JSON.stringify(serverConfig))
387 const configScriptTag = `<script type="application/javascript">window.PeerTubeServerConfig = ${serverConfigString}</script>`
387 388
388 return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag) 389 return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag)
389 } 390 }