Fix config injection with custom HTML/CSS
This commit is contained in:
parent
c504295581
commit
b4c945f3c7
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue