(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestDecompress_skippedIfNoHeader(t *testing.T) { |
| 47 | e := echo.New() |
| 48 | req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader("test")) |
| 49 | rec := httptest.NewRecorder() |
| 50 | c := e.NewContext(req, rec) |
| 51 | |
| 52 | // Skip if no Content-Encoding header |
| 53 | h := Decompress()(func(c *echo.Context) error { |
| 54 | c.Response().Write([]byte("test")) // For Content-Type sniffing |
| 55 | return nil |
| 56 | }) |
| 57 | |
| 58 | err := h(c) |
| 59 | assert.NoError(t, err) |
| 60 | assert.Equal(t, "test", rec.Body.String()) |
| 61 | |
| 62 | } |
| 63 | |
| 64 | func TestDecompressWithConfig_DefaultConfig_noDecode(t *testing.T) { |
| 65 | e := echo.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…