Verified Commit b4c945f3 authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix config injection with custom HTML/CSS

parent c5042955
......@@ -382,8 +382,9 @@ class ClientHtml {
}
private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) {
const serverConfigString = JSON.stringify(serverConfig)
const configScriptTag = `<script type="application/javascript">window.PeerTubeServerConfig = '${serverConfigString}'</script>`
// 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 = `<script type="application/javascript">window.PeerTubeServerConfig = ${serverConfigString}</script>`
return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment