Simplification of middleware example (#1423)

Signed-off-by: Alexey Michurin <a.michurin@gmail.com>
This commit is contained in:
Alexey Michurin 2024-01-08 19:45:31 +03:00 committed by GitHub
parent 6636d6a23a
commit d9be4042d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -79,9 +79,7 @@ func (m *middleware) WrapHandler(handlerName string, handler http.Handler) http.
requestSize,
promhttp.InstrumentHandlerResponseSize(
responseSize,
http.HandlerFunc(func(writer http.ResponseWriter, r *http.Request) {
handler.ServeHTTP(writer, r)
}),
handler,
),
),
),