1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-01 22:51:17 +02:00

Bug in gzip, fixed #95, #96.

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-06-09 15:24:01 -07:00
parent 1ac5425ec4
commit ae721bd2b2
5 changed files with 41 additions and 15 deletions

View File

@@ -24,14 +24,6 @@ func TestGzip(t *testing.T) {
assert.Equal(t, http.StatusOK, rec.Code)
assert.Equal(t, "test", rec.Body.String())
// Skip if WebSocket
rec = httptest.NewRecorder()
c = echo.NewContext(req, echo.NewResponse(rec), echo.New())
c.Request().Header.Set(echo.Upgrade, echo.WebSocket)
Gzip()(h)(c)
assert.Equal(t, http.StatusOK, rec.Code)
assert.NotEqual(t, "gzip", rec.Header().Get(echo.ContentEncoding))
// Gzip
req, _ = http.NewRequest(echo.GET, "/", nil)
req.Header.Set(echo.AcceptEncoding, "gzip")