mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-07 14:35:23 -04:00
own the usage of reflection into the RegisterType
allowing the users to only pass instances of the interfaces
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -38,8 +37,8 @@ import (
|
||||
|
||||
func init() {
|
||||
caddy.RegisterModule(Encode{})
|
||||
caddy.RegisterType("http.encoders", []reflect.Type{
|
||||
reflect.TypeOf((*Encoding)(nil)).Elem(),
|
||||
caddy.RegisterType("http.encoders", []interface{}{
|
||||
(*Encoding)(nil),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user