diff --git a/graphql/graphiql.go b/graphql/graphiql.go index dfb6b6169b..96810fa0bc 100644 --- a/graphql/graphiql.go +++ b/graphql/graphiql.go @@ -52,7 +52,7 @@ func errorJSON(msg string) []byte { return buf.Bytes() } -func (h GraphiQL) webHandler(w http.ResponseWriter, r *http.Request) { +func (h GraphiQL) ServeHTTP(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { respond(w, errorJSON("only GET requests are supported"), http.StatusMethodNotAllowed) return diff --git a/graphql/graphql.go b/graphql/graphql.go index c031bb0534..d22a3afb6f 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -1158,7 +1158,7 @@ func NewHandler(be *eth.EthAPIBackend) (http.Handler, error) { h := &relay.Handler{Schema: s} mux := http.NewServeMux() - mux.HandleFunc("/", (GraphiQL{}).webHandler) + mux.Handle("/", GraphiQL{}) mux.Handle("/graphql", h) mux.Handle("/graphql/", h) return mux, nil