From 7ef13116a0794b8747054ec3250702046d3d58e0 Mon Sep 17 00:00:00 2001 From: Qiu shao Date: Fri, 2 May 2025 14:59:36 +0800 Subject: [PATCH] feat: add http to http method test case (#4820) --- gateway/server_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gateway/server_test.go b/gateway/server_test.go index 3655fab31..80c7693c0 100644 --- a/gateway/server_test.go +++ b/gateway/server_test.go @@ -201,6 +201,13 @@ func TestHttpToHttp(t *testing.T) { assert.NoError(t, err) assert.Equal(t, http.StatusNotFound, resp.StatusCode) }) + + t.Run("method not allowed", func(t *testing.T) { + resp, err := httpc.Do(context.Background(), http.MethodPost, + "http://localhost:18882/api/ping", nil) + assert.NoError(t, err) + assert.Equal(t, http.StatusMethodNotAllowed, resp.StatusCode) + }) } func TestHttpToHttpBadUpstream(t *testing.T) {