(t *testing.T)
| 256 | } |
| 257 | |
| 258 | func 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 | |
| 276 | func TestGzipWithMinLengthChunked(t *testing.T) { |
| 277 | e := echo.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…