Skip to content

Commit dc7e235

Browse files
author
Emil Pirfält
committed
Accept any http.Handler implementation in HandlerFuncAdapter
The adapter already uses handlerFunc via it's interface, calls `handlerFunc.ServeHTTP(args)` instead of `handlerFunc(args)`. Change to accept any interface implementation instead of only the `http.HandlerFunc` implementation.
1 parent 3a4d350 commit dc7e235

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

handlerfunc/adapter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99

1010
type HandlerFuncAdapter struct {
1111
core.RequestAccessor
12-
handlerFunc http.HandlerFunc
12+
handlerFunc http.Handler
1313
}
1414

15-
func New(handlerFunc http.HandlerFunc) *HandlerFuncAdapter {
15+
func New(handler http.Handler) *HandlerFuncAdapter {
1616
return &HandlerFuncAdapter{
17-
handlerFunc: handlerFunc,
17+
handlerFunc: handler,
1818
}
1919
}
2020

0 commit comments

Comments
 (0)