lib/httpserver: remove unnecessary http.HandlerFunc wrapper in gzipHandler

This commit is contained in:
Aliaksandr Valialkin 2020-04-01 18:14:17 +03:00
parent b3cb188c59
commit 84fa146792

View file

@ -114,7 +114,7 @@ func Stop(addr string) error {
}
func gzipHandler(rh RequestHandler) http.HandlerFunc {
hf := func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w = maybeGzipResponseWriter(w, r)
handlerWrapper(w, r, rh)
if zrw, ok := w.(*gzipResponseWriter); ok {
@ -123,7 +123,6 @@ func gzipHandler(rh RequestHandler) http.HandlerFunc {
}
}
}
return http.HandlerFunc(hf)
}
var metricsHandlerDuration = metrics.NewHistogram(`vm_http_request_duration_seconds{path="/metrics"}`)