diff options
author | Determinant <[email protected]> | 2020-06-07 16:46:44 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-06-07 16:46:44 -0400 |
commit | ab977c426fe8021275fc1c7fd6cdb80d42191886 (patch) | |
tree | 8489ef1fa241969476ab4eb3b27898b0314fcc33 | |
parent | 4ba8654f8cefd069cd730a51ce516ad76931a354 (diff) |
-rw-r--r-- | plugin/evm/vm.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index c10e2b9..57b2eda 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -338,11 +338,11 @@ func (ipf ipFilter) ServeHTTP(writer http.ResponseWriter, request *http.Request) ipf.handler.ServeHTTP(writer, request) return } - writer.WriterHeader(404) + writer.WriteHeader(404) } -func NewIPFilter(handler http.Handler) { - ipFilter{handler} +func newIPFilter(handler http.Handler) http.Handler { + return ipFilter{handler} } // CreateHandlers makes new http handlers that can handle API calls @@ -355,8 +355,8 @@ func (vm *VM) CreateHandlers() map[string]*commonEng.HTTPHandler { handler.RegisterName("debug", &DebugAPI{vm}) return map[string]*commonEng.HTTPHandler{ - "/rpc": &commonEng.HTTPHandler{LockOptions: commonEng.NoLock, Handler: NewIPFilter(handler)}, - "/ws": &commonEng.HTTPHandler{LockOptions: commonEng.NoLock, Handler: NewIPFilter(handler.WebsocketHandler([]string{"*"}))}, + "/rpc": &commonEng.HTTPHandler{LockOptions: commonEng.NoLock, Handler: newIPFilter(handler)}, + "/ws": &commonEng.HTTPHandler{LockOptions: commonEng.NoLock, Handler: newIPFilter(handler.WebsocketHandler([]string{"*"}))}, } } |