From: Dessalines Date: Wed, 23 Sep 2020 18:46:50 +0000 (-0500) Subject: Fix opengraph tags. Fixes #36 X-Git-Url: http://these/git/%7B%60/feeds/front/static/%7BpictrsAvatarThumbnail%28this.state.siteRes.site.icon%29%7D?a=commitdiff_plain;h=f9c0c72bb935c645197c93ad690daf6b603f95df;p=lemmy-ui.git Fix opengraph tags. Fixes #36 --- diff --git a/src/server/index.tsx b/src/server/index.tsx index b7577ca..33cfe57 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -43,7 +43,9 @@ server.get('/*', async (req, res) => { let site: GetSiteResponse = resolver[0]; let routeData = resolver.slice(1, resolver.length); - let acceptLang = req.headers['accept-language'].split(',')[0]; + let acceptLang = req.headers['accept-language'] + ? req.headers['accept-language'].split(',')[0] + : 'en'; let lang = !!site.my_user ? site.my_user.lang == 'browser' ? acceptLang