MCPcopy
hub / github.com/labstack/echo / TestGzipWithResponseWithoutBody

Function TestGzipWithResponseWithoutBody

middleware/compress_test.go:258–274  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

256}
257
258func TestGzipWithResponseWithoutBody(t *testing.T) {
259 e := echo.New()
260
261 e.Use(Gzip())
262 e.GET("/", func(c *echo.Context) error {
263 return c.Redirect(http.StatusMovedPermanently, "http://localhost")
264 })
265
266 req := httptest.NewRequest(http.MethodGet, "/", nil)
267 req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme)
268 rec := httptest.NewRecorder()
269
270 e.ServeHTTP(rec, req)
271
272 assert.Equal(t, http.StatusMovedPermanently, rec.Code)
273 assert.Equal(t, "", rec.Header().Get(echo.HeaderContentEncoding))
274}
275
276func TestGzipWithMinLengthChunked(t *testing.T) {
277 e := echo.New()

Callers

nothing calls this directly

Calls 8

GzipFunction · 0.85
RedirectMethod · 0.80
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…