protect slice bounds not out of range (#282)

pull/298/head
zhangji 5 years ago committed by Felix Hao
parent 5a6d1e01b0
commit 2c6eb487a3
  1. 6
      pkg/net/http/blademaster/logger.go

@ -34,8 +34,10 @@ func Logger() HandlerFunc {
caller = noUser caller = noUser
} }
_metricServerReqCodeTotal.Inc(c.RoutePath[1:], caller, strconv.FormatInt(int64(cerr.Code()), 10)) if len(c.RoutePath) > 0 {
_metricServerReqDur.Observe(int64(dt/time.Millisecond), c.RoutePath[1:], caller) _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 lf := log.Infov
errmsg := "" errmsg := ""

Loading…
Cancel
Save