mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
graphql: change HandleFunc to Handle
This commit is contained in:
parent
5e223a630a
commit
7965e9ac30
2 changed files with 2 additions and 2 deletions
|
|
@ -52,7 +52,7 @@ func errorJSON(msg string) []byte {
|
||||||
return buf.Bytes()
|
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" {
|
if r.Method != "GET" {
|
||||||
respond(w, errorJSON("only GET requests are supported"), http.StatusMethodNotAllowed)
|
respond(w, errorJSON("only GET requests are supported"), http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -1158,7 +1158,7 @@ func NewHandler(be *eth.EthAPIBackend) (http.Handler, error) {
|
||||||
h := &relay.Handler{Schema: s}
|
h := &relay.Handler{Schema: s}
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("/", (GraphiQL{}).webHandler)
|
mux.Handle("/", GraphiQL{})
|
||||||
mux.Handle("/graphql", h)
|
mux.Handle("/graphql", h)
|
||||||
mux.Handle("/graphql/", h)
|
mux.Handle("/graphql/", h)
|
||||||
return mux, nil
|
return mux, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue