MCPcopy Index your code
hub / github.com/labstack/echo / TestMethodOverride_ignoreGet

Function TestMethodOverride_ignoreGet

middleware/method_override_test.go:75–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestMethodOverride_ignoreGet(t *testing.T) {
76 e := echo.New()
77 m := MethodOverride()
78 h := func(c *echo.Context) error {
79 return c.String(http.StatusOK, "test")
80 }
81
82 // Ignore `GET`
83 req := httptest.NewRequest(http.MethodGet, "/", nil)
84 req.Header.Set(echo.HeaderXHTTPMethodOverride, http.MethodDelete)
85 rec := httptest.NewRecorder()
86 c := e.NewContext(req, rec)
87
88 err := m(h)(c)
89 assert.NoError(t, err)
90
91 assert.Equal(t, http.MethodGet, req.Method)
92}

Callers

nothing calls this directly

Calls 4

StringMethod · 0.95
MethodOverrideFunction · 0.85
SetMethod · 0.80
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…