1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-23 19:32:11 +00:00

fix: Add missing user-agent

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

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:')