mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
protect slice bounds not out of range (#282)
This commit is contained in:
parent
5a6d1e01b0
commit
2c6eb487a3
@ -34,8 +34,10 @@ func Logger() HandlerFunc {
|
||||
caller = noUser
|
||||
}
|
||||
|
||||
_metricServerReqCodeTotal.Inc(c.RoutePath[1:], caller, strconv.FormatInt(int64(cerr.Code()), 10))
|
||||
_metricServerReqDur.Observe(int64(dt/time.Millisecond), c.RoutePath[1:], caller)
|
||||
if len(c.RoutePath) > 0 {
|
||||
_metricServerReqCodeTotal.Inc(c.RoutePath[1:], caller, strconv.FormatInt(int64(cerr.Code()), 10))
|
||||
_metricServerReqDur.Observe(int64(dt/time.Millisecond), c.RoutePath[1:], caller)
|
||||
}
|
||||
|
||||
lf := log.Infov
|
||||
errmsg := ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user