diff options
Diffstat (limited to 'src/api/server.ts')
| -rw-r--r-- | src/api/server.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/server.ts b/src/api/server.ts index 0e059f5d2e..c98167eb3e 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -45,7 +45,9 @@ app.post('/signup', require('./private/signup').default); app.post('/signin', require('./private/signin').default); app.use((req, res, next) => { - res.locals.user = ((req.headers['cookie'] || '').match(/i=(!\w+)/) || [null, null])[1]; + // req.headers['cookie'] は常に string ですが、型定義の都合上 + // string | string[] になっているので string を明示しています + res.locals.user = ((req.headers['cookie'] as string || '').match(/i=(!\w+)/) || [null, null])[1]; next(); }); |