all: use http package to replace http method names (#26535)

This commit is contained in:
Shude Li
2023-01-24 11:12:25 +02:00
committed by GitHub
parent e4fa2cf5e3
commit 163e996d0e
7 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -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)
}