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

Function TestDecompressErrorReturned

middleware/decompress_test.go:145–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestDecompressErrorReturned(t *testing.T) {
146 e := echo.New()
147 e.Use(Decompress())
148 e.GET("/", func(c *echo.Context) error {
149 return echo.ErrNotFound
150 })
151 req := httptest.NewRequest(http.MethodGet, "/", nil)
152 req.Header.Set(echo.HeaderContentEncoding, GZIPEncoding)
153 rec := httptest.NewRecorder()
154
155 e.ServeHTTP(rec, req)
156
157 assert.Equal(t, http.StatusNotFound, rec.Code)
158 assert.Empty(t, rec.Header().Get(echo.HeaderContentEncoding))
159}
160
161func TestDecompressSkipper(t *testing.T) {
162 e := echo.New()

Callers

nothing calls this directly

Calls 7

DecompressFunction · 0.85
SetMethod · 0.80
ServeHTTPMethod · 0.80
UseMethod · 0.45
GETMethod · 0.45
GetMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…