From dac7a682d4189db449a1cb81cde36c7b5f381dd5 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 2 Sep 2020 23:19:50 -0700 Subject: [PATCH] oops, I broke the cached data script --- src/server/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index 469e23b..98fd781 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -1335,8 +1335,9 @@ const config = { }; lastSvgLogger = svgLogger; - const tokenMatch = (req.headers.authorization || "").match(/^Bearer (.+)$/); - const token = tokenMatch && tokenMatch[1]; + const auth = (req && req.headers && req.headers.authorization) || ""; + const authMatch = auth.match(/^Bearer (.+)$/); + const token = authMatch && authMatch[1]; const currentUserId = await getUserIdFromToken(token); return {