1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-06-16 17:39:18 +00:00

fix: Add missing user-agent

Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
2022-12-09 15:57:16 +01:00
parent 467f6e9e95
commit 2b23503864

View File

@ -21,7 +21,7 @@ server.use((_, res, next) => {
// Route logging / Error logging for debugging
server.use((req, res, next) => {
res.on('close', () => {
console.log(`[${new Date().toISOString()}]: ${req.method.padStart(7, ' ')} ${res.statusCode} ${(req.baseUrl ?? '') + req.url}`)
console.log(`[${new Date().toISOString()}] ${req.headers['user-agent']?.slice(0, 32).padEnd(32)} ${req.method.padEnd(7)} ${res.statusCode} ${(req.baseUrl ?? '') + req.url}`)
})
res.on('error', (err) => {
console.error('Error:')