(t *testing.T)
| 18 | ) |
| 19 | |
| 20 | func TestGzip_NoAcceptEncodingHeader(t *testing.T) { |
| 21 | // Skip if no Accept-Encoding header |
| 22 | h := Gzip()(func(c *echo.Context) error { |
| 23 | c.Response().Write([]byte("test")) // For Content-Type sniffing |
| 24 | return nil |
| 25 | }) |
| 26 | |
| 27 | e := echo.New() |
| 28 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 29 | rec := httptest.NewRecorder() |
| 30 | c := e.NewContext(req, rec) |
| 31 | |
| 32 | err := h(c) |
| 33 | assert.NoError(t, err) |
| 34 | |
| 35 | assert.Equal(t, "test", rec.Body.String()) |
| 36 | } |
| 37 | |
| 38 | func TestMustGzipWithConfig_panics(t *testing.T) { |
| 39 | assert.Panics(t, func() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…