From ab977c426fe8021275fc1c7fd6cdb80d42191886 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 7 Jun 2020 16:46:44 -0400 Subject: ... --- plugin/evm/vm.go | 10 +++++----- 1 file 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{"*"}))}, } } -- cgit v1.2.3