Skip to content

Commit d9be404

Browse files
authored
Simplification of middleware example (#1423)
Signed-off-by: Alexey Michurin <[email protected]>
1 parent 6636d6a commit d9be404

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/middleware/httpmiddleware/httpmiddleware.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ func (m *middleware) WrapHandler(handlerName string, handler http.Handler) http.
7979
requestSize,
8080
promhttp.InstrumentHandlerResponseSize(
8181
responseSize,
82-
http.HandlerFunc(func(writer http.ResponseWriter, r *http.Request) {
83-
handler.ServeHTTP(writer, r)
84-
}),
82+
handler,
8583
),
8684
),
8785
),

0 commit comments

Comments
 (0)