(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestGzipWithMinLengthNoContent(t *testing.T) { |
| 336 | e := echo.New() |
| 337 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 338 | req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme) |
| 339 | rec := httptest.NewRecorder() |
| 340 | c := e.NewContext(req, rec) |
| 341 | h := GzipWithConfig(GzipConfig{MinLength: 10})(func(c *echo.Context) error { |
| 342 | return c.NoContent(http.StatusNoContent) |
| 343 | }) |
| 344 | if assert.NoError(t, h(c)) { |
| 345 | assert.Empty(t, rec.Header().Get(echo.HeaderContentEncoding)) |
| 346 | assert.Empty(t, rec.Header().Get(echo.HeaderContentType)) |
| 347 | assert.Equal(t, 0, len(rec.Body.Bytes())) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func TestGzipResponseWriter_CanUnwrap(t *testing.T) { |
| 352 | trwu := &testResponseWriterUnwrapper{rw: httptest.NewRecorder()} |
nothing calls this directly
no test coverage detected
searching dependent graphs…