@samitouri / QOSami-HFS / commits / 7dfe57a7

fix: log wasn't including ?parameters in uri

Massimo Melina committed Jun 27, 2023 at 21:21 UTC 7dfe57a722ba3efe98589555807921f85f978fd7
1 file changed +2 -2
src/log.ts
+2 -2
@@ -67,7 +67,7 @@ const debounce = _.debounce(cb => cb(), 1000)
67 export const logMw: Koa.Middleware = async (ctx, next) => {
68 const now = new Date()
69 await next()
70 - console.debug(ctx.status, ctx.method, ctx.path)
70 + console.debug(ctx.status, ctx.method, ctx.originalUrl)
71 Promise.race([ once(ctx.res, 'finish'), once(ctx.res, 'close') ]).then(() => {
72 if (ctx.state.dont_log) return
73 if (dontLogNet.compiled()(ctx.ip)) return
@@ -107,7 +107,7 @@ export const logMw: Koa.Middleware = async (ctx, next) => {
107 user || '-',
108 date,
109 ctx.method,
110 - ctx.path,
110 + ctx.originalUrl,
111 ctx.req.httpVersion,
112 ctx.status,
113 length?.toString() ?? '-',