Fix isoData can contain user generated content (#1114)

* Fix isoData can contain user generated content

* Fix formatting
This commit is contained in:
0xDEADCADE 2023-06-08 15:15:03 +00:00 committed by GitHub
parent 850de94c00
commit 22a4fae0c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ import {
favIconUrl,
initializeSite,
isAuthPath,
md,
} from "../shared/utils";
const server = express();
@ -347,7 +348,9 @@ async function createSsrHtml(root: string, isoData: IsoDataOptionalSite) {
<!DOCTYPE html>
<html ${helmet.htmlAttributes.toString()} lang="en">
<head>
<script>window.isoData = ${JSON.stringify(isoData)}</script>
<script>window.isoData = ${md.utils.escapeHtml(
JSON.stringify(isoData)
)}</script>
<script>window.lemmyConfig = ${serialize(config)}</script>
<!-- A remote debugging utility for mobile -->