graphql: change HandleFunc to Handle

This commit is contained in:
Kurkó Mihály 2019-06-17 15:52:32 +03:00
parent 5e223a630a
commit 7965e9ac30
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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