cmd/geth, node: allow configuring JSON-RPC on custom path prefix (#22184)
This change allows users to set a custom path prefix on which to mount the http-rpc or ws-rpc handlers via the new flags --http.rpcprefix and --ws.rpcprefix. Fixes #21826 Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
@ -30,6 +30,8 @@ import (
|
||||
"github.com/ethereum/go-ethereum/eth"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestBuildSchema(t *testing.T) {
|
||||
@ -166,18 +168,8 @@ func TestGraphQLHTTPOnSamePort_GQLRequest_Unsuccessful(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("could not post: %v", err)
|
||||
}
|
||||
bodyBytes, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
t.Fatalf("could not read from response body: %v", err)
|
||||
}
|
||||
resp.Body.Close()
|
||||
// make sure the request is not handled successfully
|
||||
if want, have := "404 page not found\n", string(bodyBytes); have != want {
|
||||
t.Errorf("have:\n%v\nwant:\n%v", have, want)
|
||||
}
|
||||
if want, have := 404, resp.StatusCode; want != have {
|
||||
t.Errorf("wrong statuscode, have:\n%v\nwant:%v", have, want)
|
||||
}
|
||||
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
|
||||
}
|
||||
|
||||
func createNode(t *testing.T, gqlEnabled bool) *node.Node {
|
||||
|
Reference in New Issue
Block a user