From f9c0c72bb935c645197c93ad690daf6b603f95df Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 23 Sep 2020 13:46:50 -0500 Subject: [PATCH] Fix opengraph tags. Fixes #36 --- src/server/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/index.tsx b/src/server/index.tsx index b7577cad..33cfe57f 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