fixed content type check, added bit more logging on getnewdata since ep

This commit is contained in:
mrfry
2023-04-13 16:01:38 +02:00
parent b1e89249b4
commit f1a88b7ff5
4 changed files with 26 additions and 7 deletions
+3 -1
View File
@@ -53,13 +53,15 @@ export const testUser: User = {
function renderLogin(req: Request, res: Response) {
res.status(401) // Unauthorized
if (req.is('application/json')) {
if (req.headers['content-type'] === 'application/json') {
res.json({
result: 'nouser',
msg: 'You are not logged in',
})
return
} else {
res.render('login')
return
}
}