mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-08 06:55:31 -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 (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -42,8 +41,8 @@ import (
|
||||
func init() {
|
||||
weakrand.Seed(time.Now().UnixNano())
|
||||
|
||||
caddy.RegisterType("http.precompressed", []reflect.Type{
|
||||
reflect.TypeOf((*encode.Precompressed)(nil)).Elem(),
|
||||
caddy.RegisterType("http.precompressed", []interface{}{
|
||||
(*encode.Precompressed)(nil),
|
||||
})
|
||||
|
||||
caddy.RegisterModule(FileServer{})
|
||||
|
||||
Reference in New Issue
Block a user