forked from cerc-io/plugeth
all: use http package to replace http method names (#26535)
This commit is contained in:
@@ -167,7 +167,7 @@ func TestWebsocketOrigins(t *testing.T) {
|
||||
|
||||
// TestIsWebsocket tests if an incoming websocket upgrade request is handled properly.
|
||||
func TestIsWebsocket(t *testing.T) {
|
||||
r, _ := http.NewRequest("GET", "/", nil)
|
||||
r, _ := http.NewRequest(http.MethodGet, "/", nil)
|
||||
|
||||
assert.False(t, isWebsocket(r))
|
||||
r.Header.Set("upgrade", "websocket")
|
||||
@@ -294,7 +294,7 @@ func baseRpcRequest(t *testing.T, url, bodyStr string, extraHeaders ...string) *
|
||||
|
||||
// Create the request.
|
||||
body := bytes.NewReader([]byte(bodyStr))
|
||||
req, err := http.NewRequest("POST", url, body)
|
||||
req, err := http.NewRequest(http.MethodPost, url, body)
|
||||
if err != nil {
|
||||
t.Fatal("could not create http request:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user