Skip to content

Commit 1c2e4e2

Browse files
author
142vip.cn
committed
fix: 修复URL地址信息安全告警
1 parent 53ff12c commit 1c2e4e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

code/koa/koa-run-sort.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ app.use(async(ctx, next) => {
99
const middleRes1 = await next()
1010
console.log('middleware1===>', middleRes1)
1111
const rt = ctx.response.get('X-Response-Time')
12-
const { method, url } = ctx
13-
console.log(`请求信息:${method}-${url} - ${rt}`)
12+
const { method } = ctx
13+
// 也可以从ctx中获取url对象
14+
console.log(`请求信息:${method} - ${rt}`)
1415
return 'back middleware1 result'
1516
})
1617

0 commit comments

Comments
 (0)