From: Dessalines Date: Wed, 25 Nov 2020 20:06:38 +0000 (-0500) Subject: Fixing CSP for local dev X-Git-Url: http://these/git/%22https:/nerdica.net/README.es.md?a=commitdiff_plain;h=7ebcb0563b617e5c478324e32936a221675ee744;p=lemmy-ui.git Fixing CSP for local dev --- diff --git a/src/server/index.tsx b/src/server/index.tsx index 35d02c1..b2016cf 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -84,7 +84,15 @@ server.get('/*', async (req, res) => { return res.redirect(context.url); } + const cspHtml = ( + + ); + const root = renderToString(wrapper); + const cspStr = process.env.LEMMY_EXTERNAL_HOST ? renderToString(cspHtml) : ''; const helmet = Helmet.renderStatic(); res.send(` @@ -102,7 +110,7 @@ server.get('/*', async (req, res) => { - + ${cspStr}